提交 4c382558 编写于 作者: E Eyal Birger 提交者: Steffen Klassert

vti6: fix ipv4 pmtu check to honor ip header df

Frag needed should only be sent if the header enables DF.

This fix allows IPv4 packets larger than MTU to pass the vti6 interface
and be fragmented after encapsulation, aligning behavior with
non-vti6 xfrm.

Fixes: ccd740cb ("vti6: Add pmtu handling to vti6_xmit.")
Signed-off-by: NEyal Birger <eyal.birger@gmail.com>
Reviewed-by: NSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 c7c1abfd
...@@ -494,7 +494,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) ...@@ -494,7 +494,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
} }
if (dst->flags & DST_XFRM_QUEUE) if (dst->flags & DST_XFRM_QUEUE)
goto queued; goto xmit;
x = dst->xfrm; x = dst->xfrm;
if (!vti6_state_check(x, &t->parms.raddr, &t->parms.laddr)) if (!vti6_state_check(x, &t->parms.raddr, &t->parms.laddr))
...@@ -523,6 +523,8 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) ...@@ -523,6 +523,8 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
} else { } else {
if (!(ip_hdr(skb)->frag_off & htons(IP_DF)))
goto xmit;
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
htonl(mtu)); htonl(mtu));
} }
...@@ -531,7 +533,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) ...@@ -531,7 +533,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
goto tx_err_dst_release; goto tx_err_dst_release;
} }
queued: xmit:
skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev))); skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev)));
skb_dst_set(skb, dst); skb_dst_set(skb, dst);
skb->dev = skb_dst(skb)->dev; skb->dev = skb_dst(skb)->dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册