diff options
| author | David Stevens <dlstevens@us.ibm.com> | 2003-11-21 00:49:32 -0800 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-11-21 00:49:32 -0800 |
| commit | eb05aab5fd1ea97dcac4c9c0af221beebfc5bc05 (patch) | |
| tree | ed2a8a5578ca9e0838701502195181eb79389802 /net | |
| parent | a7a339c0816af0d8cf7b96615341f616807091b3 (diff) | |
[IPV6]: Fix header length calculation in multicast input.
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.
Diffstat (limited to 'net')
| -rw-r--r-- | net/ipv6/mcast.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 883bf65c3ae5..af95ae08ff0d 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -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)) |
