From owner-freebsd-net Wed Mar 27 21:30:56 2002 Delivered-To: freebsd-net@freebsd.org Received: from mgo.iij.ad.jp (mgo.iij.ad.jp [202.232.15.6]) by hub.freebsd.org (Postfix) with ESMTP id BEA2E37B405 for ; Wed, 27 Mar 2002 21:30:48 -0800 (PST) Received: from ns.iij.ad.jp (ns.iij.ad.jp [192.168.2.8]) by mgo.iij.ad.jp (8.8.8/MGO1.0) with ESMTP id OAA22855 for ; Thu, 28 Mar 2002 14:30:47 +0900 (JST) Received: from localhost (keiichi01.osaka.iij.ad.jp [192.168.65.66]) by ns.iij.ad.jp (8.8.5/3.5Wpl7) with ESMTP id OAA03261 for ; Thu, 28 Mar 2002 14:30:47 +0900 (JST) Date: Thu, 28 Mar 2002 14:30:43 +0900 (JST) Message-Id: <20020328.143043.67876714.keiichi@iij.ad.jp> To: freebsd-net@FreeBSD.ORG Subject: Re: problems with udp46 sockets From: Keiichi SHIMA / =?iso-2022-jp?B?GyRCRWc3RDBsGyhC?= In-Reply-To: <20020327201119.E68348@Space.Net> References: <20020326231734.H58573@Space.Net> <20020327.162320.922733592.keiichi@iij.ad.jp> <20020327201119.E68348@Space.Net> X-Mailer: Mew version 3.0.55 on XEmacs 21.1.14 (Cuyahoga Valley) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Mar_28_14:30:43_2002_965)--" Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org ----Next_Part(Thu_Mar_28_14:30:43_2002_965)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Markus Stumpf > > Thanks a lot! I have applied the patches and it works only partially. Sorry, it needs more work... Please revert the previous patches, and try with these attached again. --- Keiichi SHIMA IIJ Research Laboratory KAME Project ----Next_Part(Thu_Mar_28_14:30:43_2002_965)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="in_pcb.c.diff" --- in_pcb.c.orig Thu Mar 28 14:13:23 2002 +++ in_pcb.c Thu Mar 28 14:15:10 2002 @@ -411,9 +411,10 @@ */ ro = &inp->inp_route; if (ro->ro_rt && - (satosin(&ro->ro_dst)->sin_addr.s_addr != - sin->sin_addr.s_addr || - inp->inp_socket->so_options & SO_DONTROUTE)) { + (ro->ro_dst.sa_family != AF_INET || + satosin(&ro->ro_dst)->sin_addr.s_addr != + sin->sin_addr.s_addr || + inp->inp_socket->so_options & SO_DONTROUTE)) { RTFREE(ro->ro_rt); ro->ro_rt = (struct rtentry *)0; } @@ -421,6 +422,7 @@ (ro->ro_rt == (struct rtentry *)0 || ro->ro_rt->rt_ifp == (struct ifnet *)0)) { /* No route yet, so try to acquire one */ + bzero(&ro->ro_dst, sizeof(struct sockaddr_in)); ro->ro_dst.sa_family = AF_INET; ro->ro_dst.sa_len = sizeof(struct sockaddr_in); ((struct sockaddr_in *) &ro->ro_dst)->sin_addr = ----Next_Part(Thu_Mar_28_14:30:43_2002_965)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ip_output.c.diff" --- ip_output.c.orig Wed Mar 27 14:29:43 2002 +++ ip_output.c Thu Mar 28 14:15:56 2002 @@ -219,11 +219,13 @@ * and is still up. If not, free it and try again. */ if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 || + dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { RTFREE(ro->ro_rt); ro->ro_rt = (struct rtentry *)0; } if (ro->ro_rt == 0) { + bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = ip->ip_dst; ----Next_Part(Thu_Mar_28_14:30:43_2002_965)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ip6_output.c.diff" --- ip6_output.c.orig Wed Mar 27 14:23:54 2002 +++ ip6_output.c Wed Mar 27 14:08:22 2002 @@ -461,6 +461,7 @@ * and is still up. If not, free it and try again. */ if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 || + dst->sin6_family != AF_INET6 || !IN6_ARE_ADDR_EQUAL(&dst->sin6_addr, &ip6->ip6_dst))) { RTFREE(ro->ro_rt); ro->ro_rt = (struct rtentry *)0; ----Next_Part(Thu_Mar_28_14:30:43_2002_965)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="in6_src.c.diff" --- in6_src.c.orig Wed Mar 27 14:24:28 2002 +++ in6_src.c Wed Mar 27 14:47:31 2002 @@ -239,7 +239,9 @@ */ if (ro) { if (ro->ro_rt && - !IN6_ARE_ADDR_EQUAL(&satosin6(&ro->ro_dst)->sin6_addr, dst)) { + (!(ro->ro_rt->rt_flags & RTF_UP) || + ro->ro_dst.sin6_family != AF_INET6 || + !IN6_ARE_ADDR_EQUAL(&satosin6(&ro->ro_dst)->sin6_addr, dst))) { RTFREE(ro->ro_rt); ro->ro_rt = (struct rtentry *)0; } ----Next_Part(Thu_Mar_28_14:30:43_2002_965)---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message