Netdev List
 help / color / mirror / Atom feed
From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: davem@davemloft.net
Cc: herbert@gondor.apana.org.au, netdev@oss.sgi.com,
	yoshfuji@linux-ipv6.org, kazunori@miyazawa.org
Subject: Re: [XFRM] Call dst_check() with appropriate cookie
Date: Tue, 24 May 2005 17:49:31 +0900 (JST)	[thread overview]
Message-ID: <20050524.174931.46801018.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <20050524082021.GA31446@gondor.apana.org.au>

In article <20050524082021.GA31446@gondor.apana.org.au> (at Tue, 24 May 2005 18:20:21 +1000), Herbert Xu <herbert@gondor.apana.org.au> says:

> Also, can rt6i_node be NULL?

Good point.  Here's updated patch.

-----------------
From: Kazunori Miyazawa <kazunori@miyazawa.org>

[XFRM] Call dst_check() with appropriate cookie

This fixes infinite loop issue with IPv6 tunnel mode.

Signed-off-by: Kazunori Miyazawa <kazunori@miyazawa.org>
Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>

Index: include/net/xfrm.h
===================================================================
--- 5b713315560487f8c288820b17061fe27016c2cc/include/net/xfrm.h  (mode:100644)
+++ uncommitted/include/net/xfrm.h  (mode:100644)
@@ -515,6 +515,8 @@
 	struct dst_entry *route;
 	u32 route_mtu_cached;
 	u32 child_mtu_cached;
+	u32 route_cookie;
+	u32 path_cookie;
 };
 
 static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
Index: net/ipv6/xfrm6_policy.c
===================================================================
--- 5b713315560487f8c288820b17061fe27016c2cc/net/ipv6/xfrm6_policy.c  (mode:100644)
+++ uncommitted/net/ipv6/xfrm6_policy.c  (mode:100644)
@@ -113,6 +113,8 @@
 
 		xdst = (struct xfrm_dst *)dst1;
 		xdst->route = &rt->u.dst;
+		if (rt->rt6i_node)
+			xdst->route_cookie = rt->rt6i_node->fn_sernum;
 
 		dst1->next = dst_prev;
 		dst_prev = dst1;
@@ -137,6 +139,8 @@
 
 	dst_prev->child = &rt->u.dst;
 	dst->path = &rt->u.dst;
+	if (rt->rt6i_node)
+		((struct xfrm_dst *)dst)->path_cookie = rt->rt6i_node->fn_sernum;
 
 	*dst_p = dst;
 	dst = dst_prev;
Index: net/xfrm/xfrm_policy.c
===================================================================
--- 5b713315560487f8c288820b17061fe27016c2cc/net/xfrm/xfrm_policy.c  (mode:100644)
+++ uncommitted/net/xfrm/xfrm_policy.c  (mode:100644)
@@ -1136,7 +1136,7 @@
 	struct xfrm_dst *last;
 	u32 mtu;
 
-	if (!dst_check(dst->path, 0) ||
+	if (!dst_check(dst->path, ((struct xfrm_dst *)dst)->path_cookie) ||
 	    (dst->dev && !netif_running(dst->dev)))
 		return 0;
 
@@ -1156,7 +1156,7 @@
 			xdst->child_mtu_cached = mtu;
 		}
 
-		if (!dst_check(xdst->route, 0))
+		if (!dst_check(xdst->route, xdst->route_cookie))
 			return 0;
 		mtu = dst_mtu(xdst->route);
 		if (xdst->route_mtu_cached != mtu) {

-- 
YOSHIFUJI Hideaki @ USAGI Project  <yoshfuji@linux-ipv6.org>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

  reply	other threads:[~2005-05-24  8:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-24  3:49 [XFRM] Call dst_check() with appropriate cookie YOSHIFUJI Hideaki / 吉藤英明
2005-05-24  7:16 ` Herbert Xu
2005-05-24  7:30   ` YOSHIFUJI Hideaki / 吉藤英明
2005-05-24  8:11     ` Herbert Xu
2005-05-24  8:26   ` Kazunori Miyazawa
2005-05-24  8:34     ` Herbert Xu
2005-05-24 12:50       ` Herbert Xu
     [not found]     ` <20050524.174234.00553944.yoshfuji@linux-ipv6.org>
2005-05-24 12:54       ` Herbert Xu
2005-05-24  8:20 ` Herbert Xu
2005-05-24  8:49   ` YOSHIFUJI Hideaki / 吉藤英明 [this message]
2005-05-24 11:59     ` Herbert Xu
2005-05-25 23:40       ` David S. Miller

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=20050524.174931.46801018.yoshfuji@linux-ipv6.org \
    --to=yoshfuji@linux-ipv6.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kazunori@miyazawa.org \
    --cc=netdev@oss.sgi.com \
    /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