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

2 messages, 2 authors, 2003-11-22 · open the first message on its own page

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

From: David Stevens <hidden>
Date: 2003-11-22 00:08:07




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)

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

From: David S. Miller <hidden>
Date: 2003-11-22 00:46:21

On Fri, 21 Nov 2003 17:08:07 -0700
David Stevens [off-list ref] wrote:
      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.
Looks good.  I assume that all extension headers must appear
_before_ the igmp stuff, and therefore no other headers may
appear afterwards.

I'll apply this, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help