History

ipv6: udp: fix the wrong headroom check

At this point, skb->data points to skb_transport_header. So, headroom check is wrong. For some case:bridge(UFO is on) + eth device(UFO is off), there is no enough headroom for IPv6 frag head. But headroom check is always false. This will bring about data be moved to there prior to skb->head, when adding IPv6 frag header to skb.

Shan Wei committed 15 years ago

Commit a9cf73e1 parent 10022a61 file · +1 −1Browse files

Unified · Split

net/ipv6/udp.c+1−1
@@ -1335,7 +1335,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features) · 1334 unmodified lines
13351335 skb->ip_summed = CHECKSUM_NONE;
13361336
13371337 /* Check if there is enough headroom to insert fragment header. */
1338− if ((skb_headroom(skb) < frag_hdr_sz) &&
1338+ if ((skb_mac_header(skb) < skb->head + frag_hdr_sz) &&
13391339 pskb_expand_head(skb, frag_hdr_sz, 0, GFP_ATOMIC))
13401340 goto out;
13411341