Re: [RFT] remove skb_linearize from igmp.c
From: David S. Miller <hidden>
Date: 2003-06-23 19:02:29
From: David S. Miller <hidden>
Date: 2003-06-23 19:02:29
From: Stephen Hemminger [off-list ref]
Date: Mon, 23 Jun 2003 12:03:42 -0700
Could someone who actually receives IGMP packets test this?
Don't bother, your patch is buggy.
int len = skb->len;
...
+ if (!pskb_may_pull(skb, sizeof(struct igmphdr)))
+ goto drop;
+
+ ih = skb->h.igmph;
+ if (ip_compute_csum((void *)ih, len))
+ goto drop;
You're only verifying that "sizeof(struct igmphdr)" is available at
skb->data, then you dereference "len" bytes via the call to
ip_compute_csum().