Date: Sat, 30 Mar 2002 01:38:59 +0900 From: Hajimu UMEMOTO <ume@mahoroba.org> To: freebsd-net@FreeBSD.org Subject: route add -inet6 default ::1 -ifp gif0 Message-ID: <ygelmcbpbvg.wl@mille.mahoroba.org>
next in thread | raw e-mail | index | archive | help
Hi, The commit log of http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/net/if.c.diff?r1=3D1.123&r2= =3D1.124 says: Benefit: the following command now works. Previously we needed two route(8) invocations, "add" then "change". # route add -inet6 default ::1 -ifp gif0 But, actually `route add -inet6 default ::1 -ifp gif0' doesn't work. This is because following code is in sys/net/if.c: if ( #ifdef INET6 /* XXX: for maching gif tunnel dst as routing entry gateway */ addr->sa_family !=3D AF_INET6 && #endif ifp->if_flags & IFF_POINTOPOINT) { /* * This is a bit broken as it doesn't * take into account that the remote end may * be a single node in the network we are * looking for. * The trouble is that we don't know the * netmask for the remote end. */ if (ifa->ifa_dstaddr !=3D 0 && equal(addr, ifa->ifa_dstaddr)) return (ifa); } else { The commit log of http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/net/if.c.diff?r1=3D1.13&r2=3D= 1.14 says: Added a fix for a bug which caused the wrong interface to be selected for broadcasts if point-to-point links shared the same IP address as the ethernet. The fix must be enabled with P2P_LOCALADDR_SHARE option in the kernel config file. This will someday likely be standard, but there isn't sufficient time before release to determine if there are any interoperability problems with routed and/or gated. =46rom the commit log, I think this is specific to AF_INET. So, I wish to commit following change: Index: sys/net/if.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if.c,v retrieving revision 1.127 diff -u -r1.127 if.c --- sys/net/if.c 18 Jan 2002 14:33:03 -0000 1.127 +++ sys/net/if.c 29 Mar 2002 16:16:11 -0000 @@ -830,10 +830,7 @@ =20 if (ifa->ifa_addr->sa_family !=3D af) next: continue; - if ( -#ifdef INET6 /* XXX: for maching gif tunnel dst as routing entry gateway */ - addr->sa_family !=3D AF_INET6 && -#endif + if (addr->sa_family =3D=3D AF_INET && ifp->if_flags & IFF_POINTOPOINT) { /* * This is a bit broken as it doesn't Any objection? -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygelmcbpbvg.wl>