netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Haley <Brian.Haley@hp.com>
To: yoshfuji@linux-ipv6.org
Cc: davem@davemloft.net, netdev@oss.sgi.com, kazunori@miyazawa.org
Subject: Re: [PATCH, TAKE 2] [IPV6] XFRM: extract xfrm_lookup() from ip6_dst_lookup() (is Re: [PATCH][IPv6] separation xfrm_lookup from ip6_dst_lookup)
Date: Mon, 25 Oct 2004 17:27:44 -0400	[thread overview]
Message-ID: <417D6FD0.7010903@hp.com> (raw)
In-Reply-To: <20040828.014935.131415609.yoshfuji@linux-ipv6.org>

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


YOSHIFUJI Hideaki / 吉藤英明 wrote:

> Here's the updated patch.

<snip>

Hi,

I finally tracked-down the patch that fixed the IPv6 routing header 
problems I'd been seeing :)  But I think you missed one code path from 
the original patch Kazunori posted in tcp_v6_xmit(), which I think is 
only called from the ND code.

Attached is a patch that fixes that and also brings the rt0_hdr struct 
in-line with RFC 3542 by removing the "bitmap" field.

Thanks,

-Brian

--
Brian Haley, HP Linux and Open Source Lab

[-- Attachment #2: rt0.diffs --]
[-- Type: text/plain, Size: 2800 bytes --]

Signed-off-by: Brian.Haley@hp.com

--- linux-2.6.9.orig/include/linux/ipv6.h	2004-10-18 17:54:39.000000000 -0400
+++ linux-2.6.9.rt0/include/linux/ipv6.h	2004-10-22 17:15:52.000000000 -0400
@@ -68,7 +68,7 @@
 
 struct rt0_hdr {
 	struct ipv6_rt_hdr	rt_hdr;
-	__u32			bitmap;		/* strict/loose bit map */
+	__u32			reserved;
 	struct in6_addr		addr[0];
 
 #define rt0_type		rt_hdr.type
--- linux-2.6.9.orig/net/ipv6/netfilter/ip6t_rt.c	2004-10-22 16:09:32.000000000 -0400
+++ linux-2.6.9.rt0/net/ipv6/netfilter/ip6t_rt.c	2004-10-22 17:14:55.410800617 -0400
@@ -159,8 +159,8 @@
                            ((rtinfo->hdrlen == hdrlen) ^
                            !!(rtinfo->invflags & IP6T_RT_INV_LEN))));
        DEBUGP("res %02X %02X %02X ", 
-       		(rtinfo->flags & IP6T_RT_RES), ((struct rt0_hdr *)route)->bitmap,
-       		!((rtinfo->flags & IP6T_RT_RES) && (((struct rt0_hdr *)route)->bitmap)));
+       		(rtinfo->flags & IP6T_RT_RES), ((struct rt0_hdr *)route)->reserved,
+       		!((rtinfo->flags & IP6T_RT_RES) && (((struct rt0_hdr *)route)->reserved)));
 
        ret = (route != NULL)
        		&&
@@ -176,7 +176,7 @@
                            ((rtinfo->rt_type == route->type) ^
                            !!(rtinfo->invflags & IP6T_RT_INV_TYP)))
 		&&
-       		!((rtinfo->flags & IP6T_RT_RES) && (((struct rt0_hdr *)route)->bitmap));
+       		!((rtinfo->flags & IP6T_RT_RES) && (((struct rt0_hdr *)route)->reserved));
 
 	DEBUGP("#%d ",rtinfo->addrnr);
        temp = len = ptr = 0;
--- linux-2.6.9.orig/net/ipv6/tcp_ipv6.c	2004-10-18 17:54:32.000000000 -0400
+++ linux-2.6.9.rt0/net/ipv6/tcp_ipv6.c	2004-10-22 17:13:43.386387437 -0400
@@ -1802,6 +1802,7 @@
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	struct flowi fl;
 	struct dst_entry *dst;
+	struct in6_addr *final_p = NULL, final;
 
 	memset(&fl, 0, sizeof(fl));
 	fl.proto = IPPROTO_TCP;
@@ -1815,7 +1816,9 @@
 
 	if (np->opt && np->opt->srcrt) {
 		struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
+		ipv6_addr_copy(&final, &fl.fl6_dst);
 		ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
+		final_p = &final;
 	}
 
 	dst = __sk_dst_check(sk, np->dst_cookie);
@@ -1828,6 +1831,9 @@
 			return err;
 		}
 
+		if (final_p)
+			ipv6_addr_copy(&fl.fl6_dst, final_p);
+
 		if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) {
 			sk->sk_route_caps = 0;
 			dst_release(dst);
--- linux-2.6.9.orig/net/ipv6/exthdrs.c	2004-10-18 17:53:07.000000000 -0400
+++ linux-2.6.9.rt0/net/ipv6/exthdrs.c	2004-10-22 17:14:12.413730831 -0400
@@ -404,8 +404,7 @@
 
 	memcpy(opt->srcrt, hdr, sizeof(*hdr));
 	irthdr = (struct rt0_hdr*)opt->srcrt;
-	/* Obsolete field, MBZ, when originated by us */
-	irthdr->bitmap = 0;
+	irthdr->reserved = 0;
 	opt->srcrt->segments_left = n;
 	for (i=0; i<n; i++)
 		memcpy(irthdr->addr+i, rthdr->addr+(n-1-i), 16);

  parent reply	other threads:[~2004-10-25 21:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-30  8:12 [PATCH][IPv6] separation xfrm_lookup from ip6_dst_lookup Kazunori Miyazawa
2004-08-02  2:51 ` David S. Miller
2004-08-03  9:00   ` YOSHIFUJI Hideaki / 吉藤英明
2004-08-03  9:21     ` Kazunori Miyazawa
2004-08-09 23:35     ` David S. Miller
2004-08-10  1:38       ` YOSHIFUJI Hideaki / 吉藤英明
2004-08-27 16:49   ` [PATCH, TAKE 2] [IPV6] XFRM: extract xfrm_lookup() from ip6_dst_lookup() (is Re: [PATCH][IPv6] separation xfrm_lookup from ip6_dst_lookup) YOSHIFUJI Hideaki / 吉藤英明
2004-08-28  0:02     ` David S. Miller
2004-10-25 21:27     ` Brian Haley [this message]
2004-10-26  3:55       ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-26 14:29         ` Brian Haley
2004-10-26 15:43           ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-26 18:09             ` Brian Haley
2004-10-27  0:10               ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-27 15:21                 ` Brian Haley
2004-08-02  7:41 ` [PATCH][IPv6] separation xfrm_lookup from ip6_dst_lookup Herbert Xu
2004-08-03  2:09   ` David S. Miller
2004-08-03  8:19     ` YOSHIFUJI Hideaki / 吉藤英明
2004-08-03 10:55     ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=417D6FD0.7010903@hp.com \
    --to=brian.haley@hp.com \
    --cc=davem@davemloft.net \
    --cc=kazunori@miyazawa.org \
    --cc=netdev@oss.sgi.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).