hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/ipv6/sit.c
....@@ -1094,12 +1094,13 @@
10941094
10951095 static void ipip6_tunnel_bind_dev(struct net_device *dev)
10961096 {
1097
+ struct ip_tunnel *tunnel = netdev_priv(dev);
1098
+ int t_hlen = tunnel->hlen + sizeof(struct iphdr);
10971099 struct net_device *tdev = NULL;
1098
- struct ip_tunnel *tunnel;
1100
+ int hlen = LL_MAX_HEADER;
10991101 const struct iphdr *iph;
11001102 struct flowi4 fl4;
11011103
1102
- tunnel = netdev_priv(dev);
11031104 iph = &tunnel->parms.iph;
11041105
11051106 if (iph->daddr) {
....@@ -1122,14 +1123,15 @@
11221123 tdev = __dev_get_by_index(tunnel->net, tunnel->parms.link);
11231124
11241125 if (tdev && !netif_is_l3_master(tdev)) {
1125
- int t_hlen = tunnel->hlen + sizeof(struct iphdr);
11261126 int mtu;
11271127
11281128 mtu = tdev->mtu - t_hlen;
11291129 if (mtu < IPV6_MIN_MTU)
11301130 mtu = IPV6_MIN_MTU;
11311131 WRITE_ONCE(dev->mtu, mtu);
1132
+ hlen = tdev->hard_header_len + tdev->needed_headroom;
11321133 }
1134
+ dev->needed_headroom = t_hlen + hlen;
11331135 }
11341136
11351137 static void ipip6_tunnel_update(struct ip_tunnel *t, struct ip_tunnel_parm *p,