]> git.hungrycats.org Git - linux/commitdiff
[IPV6]: Fix header length calculation in multicast input.
authorDavid Stevens <dlstevens@us.ibm.com>
Fri, 21 Nov 2003 08:49:32 +0000 (00:49 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Fri, 21 Nov 2003 08:49:32 +0000 (00:49 -0800)
It did not account for extension headers properly.  If we get
this length wrong, we do not determine if a multicast packet
is MLDv1 vs. MLDv2 correctly.

net/ipv6/mcast.c

index 883bf65c3ae54ec8b476104a2e208c1bc5ff5aa3..af95ae08ff0d65b734c66589f8fa977294eaad65 100644 (file)
@@ -1017,7 +1017,9 @@ int igmp6_event_query(struct sk_buff *skb)
        if (!pskb_may_pull(skb, sizeof(struct in6_addr)))
                return -EINVAL;
 
-       len = ntohs(skb->nh.ipv6h->payload_len);
+       /* compute payload length excluding extension headers */
+       len = ntohs(skb->nh.ipv6h->payload_len) + sizeof(struct ipv6hdr);
+       len -= (char *)skb->h.raw - (char *)skb->nh.ipv6h; 
 
        /* Drop queries with not link local source */
        if (!(ipv6_addr_type(&skb->nh.ipv6h->saddr)&IPV6_ADDR_LINKLOCAL))