2 Commits
main ... flag

Author SHA1 Message Date
tuna2134
ce3fd3cc28 fix 2026-07-06 15:21:59 +09:00
tuna2134
20cf4124c8 fix 2026-07-06 15:03:21 +09:00
2 changed files with 19 additions and 1 deletions

View File

@@ -37,6 +37,14 @@ sudo ip link set eip0 up
sudo ip addr add 192.0.2.1/30 dev eip0
```
Overlay MTUのデフォルトは1500です。Underlayの経路MTUも1500の場合、
カプセル化後の外側IPv6パケットはMTUを超えるため、送信元で経路MTU以下の
IPv6フラグメントに分割します。
```sh
sudo ip link set eip0 mtu 1500
```
## トンネルの削除
```sh

View File

@@ -32,6 +32,7 @@
#define ETHERIP6_HLEN 2
#define ETHERIP6_DEFAULT_HOP_LIMIT 64
#define ETHERIP6_MAX_MTU 9000
#define ETHERIP6_ENCAP_HLEN (sizeof(struct ipv6hdr) + ETHERIP6_HLEN)
struct etherip6_tunnel {
struct list_head list;
@@ -191,6 +192,14 @@ static netdev_tx_t etherip6_xmit(struct sk_buff *skb, struct net_device *dev)
skb->protocol = htons(ETH_P_IPV6);
skb->dev = dst->dev;
/*
* This skb used to contain an inner Ethernet frame. Clear its control
* block before handing it to IPv6, then pin source fragmentation to the
* current underlay PMTU. ip6_local_out() adds the Fragment Header and
* splits oversized packets in ip6_finish_output().
*/
memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
IP6CB(skb)->frag_max_size = dst_mtu(dst);
skb->ignore_df = 1;
skb_dst_set(skb, dst);
@@ -252,6 +261,7 @@ static void etherip6_setup(struct net_device *dev)
dev->vlan_features = 0;
dev->min_mtu = ETH_MIN_MTU;
dev->max_mtu = ETHERIP6_MAX_MTU;
dev->needed_headroom = ETHERIP6_ENCAP_HLEN;
eth_hw_addr_random(dev);
}