netdev
[Top] [All Lists]

MLD compatibility mode doesn't account for extension headers [PATCH]

To: davem@xxxxxxxxxx, netdev@xxxxxxxxxxx
Subject: MLD compatibility mode doesn't account for extension headers [PATCH]
From: David Stevens <dlstevens@xxxxxxxxxx>
Date: Fri, 21 Nov 2003 17:08:07 -0700
Importance: Normal
Sender: netdev-bounce@xxxxxxxxxxx
Sensitivity:



Dave,
      The MLD v1 compatibility mode checks don't account for the
fact that extension headers are included in the ipv6 payload_len field.
That makes MLDv1 queries that include extension headers (like
Router Alert) appear to be v2 packets.
      The below patch fixes the problem.

                              +-DLS

--- linux-2.6.0-test9-bk23F2/net/ipv6/mcast.c   2003-11-21 15:53:23.916402736 
-0800
+++ linux-2.6.0-test9-bk23F3/net/ipv6/mcast.c   2003-11-21 15:51:31.360513832 
-0800
@@ -1017,7 +1017,9 @@
      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))

(See attached file: MLDext.patch)

Attachment: MLDext.patch
Description: Binary data

<Prev in Thread] Current Thread [Next in Thread>