netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* MLD compatibility mode doesn't account for extension headers [PATCH]
@ 2003-11-22  0:08 David Stevens
  2003-11-22  0:46 ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: David Stevens @ 2003-11-22  0:08 UTC (permalink / raw)
  To: davem, netdev

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]





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 #2: MLDext.patch --]
[-- Type: application/octet-stream, Size: 601 bytes --]

--- 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))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MLD compatibility mode doesn't account for extension headers [PATCH]
  2003-11-22  0:08 MLD compatibility mode doesn't account for extension headers [PATCH] David Stevens
@ 2003-11-22  0:46 ` David S. Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2003-11-22  0:46 UTC (permalink / raw)
  To: David Stevens; +Cc: netdev

On Fri, 21 Nov 2003 17:08:07 -0700
David Stevens <dlstevens@us.ibm.com> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MLD compatibility mode doesn't account for extension headers [PATCH]
@ 2003-11-22  2:29 David Stevens
  0 siblings, 0 replies; 3+ messages in thread
From: David Stevens @ 2003-11-22  2:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev






>Looks good.  I assume that all extension headers must appear
>_before_ the igmp stuff, and therefore no other headers may
>appear afterwards.

Yes, MLD is the payload, so all extension headers must be
between the IPv6 header and the MLD header.

                        thanks, Dave,

                              +-DLS

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-22  2:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-22  0:08 MLD compatibility mode doesn't account for extension headers [PATCH] David Stevens
2003-11-22  0:46 ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2003-11-22  2:29 David Stevens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).