Re: recent MFC code to 6-STABLE kills ipv6

From: SUZUKI Shinsuke <suz_at_freebsd.org>
Date: Thu, 10 Nov 2005 07:34:53 -0800
Hi,

>>>>> On Wed, 09 Nov 2005 19:12:58 -0800
>>>>> suz_at_freebsd.org(SUZUKI Shinsuke)  said:

> Oh Boy!  This is very interesting.  I took a look at my ipfw show during
> a ping6 and see the problem.  The revpath is messed up.  I took out my
> rule:
> add deny all from any to any not verrevpath in via dc0
> and ping6 now works.
suz> I'll check it from this point of view.

I think I've found the problem.
Could you please try the following patch?

If it's okay, I'll commit and MFC it.

Thanks,
----
SUZUKI, Shinsuke _at_ KAME Project


-----
Index: ip_fw2.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_fw2.c,v
retrieving revision 1.106.2.4
diff -u -r1.106.2.4 ip_fw2.c
--- ip_fw2.c	4 Nov 2005 20:26:14 -0000	1.106.2.4
+++ ip_fw2.c	10 Nov 2005 14:44:06 -0000
_at__at_ -639,8 +639,14 _at__at_
 	if (ro.ro_rt == NULL)
 		return 0;
 
-	/* if ifp is provided, check for equality with rtentry */
-	if (ifp != NULL && ro.ro_rt->rt_ifp != ifp) {
+	/* 
+	 * if ifp is provided, check for equality with rtentry
+	 * We should use rt->rt_ifa->ifa_ifp, instead of rt->rt_ifp,
+	 * to support the case of sending packets to an address of our own.
+	 * (where the former interface is the first argument of if_simloop()
+	 *  (=ifp), the latter is lo0)
+	 */
+	if (ifp != NULL && ro.ro_rt->rt_ifa->ifa_ifp != ifp) {
 		RTFREE(ro.ro_rt);
 		return 0;
 	}
Received on Thu Nov 10 2005 - 14:36:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:47 UTC