Date: Wed, 09 Jan 2013 23:58:49 +0900 From: Hajimu UMEMOTO <ume@mahoroba.org> To: Hiroki Sato <hrs@FreeBSD.org> Cc: michiel@boland.org, stable@FreeBSD.org, uqs@FreeBSD.org Subject: Re: sendmail vs ipv6 broken after upgrade to 9.1 Message-ID: <ygezk0ie72u.wl%ume@mahoroba.org> In-Reply-To: <20130109.234210.397446040718957005.hrs@allbsd.org> References: <20130109.073354.730245417155474512.hrs@allbsd.org> <50ED6D2A.5080908@boland.org> <20130109142111.GL35868@acme.spoerlein.net> <20130109.234210.397446040718957005.hrs@allbsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Hi,
>>>>> On Wed, 09 Jan 2013 23:42:10 +0900 (JST)
>>>>> Hiroki Sato <hrs@FreeBSD.org> said:
hrs> This is because the prefix on the interface has the first priority.
hrs> Why don't you use an fe80::/10 address to route packets to the other
hrs> endpoint of tun0?
I don't like this policy. I think it reduce the availability of the
policy table. So, I'm disabling it locally by applying the attached
patch.
Sincerely,
[-- Attachment #2 --]
Index: sys/netinet6/in6_src.c
diff -u -p sys/netinet6/in6_src.c.orig sys/netinet6/in6_src.c
--- sys/netinet6/in6_src.c.orig 2011-09-23 09:51:37.000000000 +0900
+++ sys/netinet6/in6_src.c 2011-10-08 20:44:31.583463740 +0900
@@ -369,10 +369,12 @@ in6_selectsrc(struct sockaddr_in6 *dstso
*/
/* Rule 5: Prefer outgoing interface */
- if (ia_best->ia_ifp == ifp && ia->ia_ifp != ifp)
- NEXT(5);
- if (ia_best->ia_ifp != ifp && ia->ia_ifp == ifp)
- REPLACE(5);
+ if (!(ND_IFINFO(ifp)->flags & ND6_IFF_NO_PREFER_IFACE)) {
+ if (ia_best->ia_ifp == ifp && ia->ia_ifp != ifp)
+ NEXT(5);
+ if (ia_best->ia_ifp != ifp && ia->ia_ifp == ifp)
+ REPLACE(5);
+ }
/*
* Rule 6: Prefer matching label
Index: sys/netinet6/nd6.h
diff -u sys/netinet6/nd6.h.orig sys/netinet6/nd6.h
--- sys/netinet6/nd6.h.orig 2011-09-23 09:51:37.000000000 +0900
+++ sys/netinet6/nd6.h 2011-10-08 20:46:47.972777802 +0900
@@ -86,6 +86,7 @@
#define ND6_IFF_DONT_SET_IFROUTE 0x10
#define ND6_IFF_AUTO_LINKLOCAL 0x20
#define ND6_IFF_NO_RADR 0x40
+#define ND6_IFF_NO_PREFER_IFACE 0x80 /* XXX: not related to ND. */
#define ND6_CREATE LLE_CREATE
#define ND6_EXCLUSIVE LLE_EXCLUSIVE
Index: usr.sbin/ndp/ndp.8
diff -u usr.sbin/ndp/ndp.8.orig usr.sbin/ndp/ndp.8
--- usr.sbin/ndp/ndp.8.orig 2011-09-23 09:51:37.000000000 +0900
+++ usr.sbin/ndp/ndp.8 2011-10-08 20:44:31.586462415 +0900
@@ -201,6 +201,15 @@
selection, see the
.Pa IMPLEMENTATION
file supplied with the KAME kit.
+.It Ic no_prefer_iface
+The address on the outgoing interface is preferred by source addess
+selection rule.
+If this flag is set, stop treating the address on the
+.Ar interface
+as special even when the
+.Ar interface
+is outgoing interface.
+The default value of this flag is off.
.It Ic disabled
Disable IPv6 operation on the interface.
When disabled, the interface discards any IPv6 packets
Index: usr.sbin/ndp/ndp.c
diff -u -p usr.sbin/ndp/ndp.c.orig usr.sbin/ndp/ndp.c
--- usr.sbin/ndp/ndp.c.orig 2011-09-23 09:51:37.000000000 +0900
+++ usr.sbin/ndp/ndp.c 2011-10-08 20:44:31.588462742 +0900
@@ -1011,6 +1011,9 @@ ifinfo(ifname, argc, argv)
#ifdef ND6_IFF_PREFER_SOURCE
SETFLAG("prefer_source", ND6_IFF_PREFER_SOURCE);
#endif
+#ifdef ND6_IFF_NO_PREFER_IFACE
+ SETFLAG("no_prefer_iface", ND6_IFF_NO_PREFER_IFACE);
+#endif
SETVALUE("basereachable", ND.basereachable);
SETVALUE("retrans", ND.retrans);
SETVALUE("curhlim", ND.chlim);
@@ -1088,6 +1091,10 @@ ifinfo(ifname, argc, argv)
if ((ND.flags & ND6_IFF_PREFER_SOURCE))
printf("prefer_source ");
#endif
+#ifdef ND6_IFF_NO_PREFER_IFACE
+ if ((ND.flags & ND6_IFF_NO_PREFER_IFACE))
+ printf("no_prefer_iface ");
+#endif
}
putc('\n', stdout);
#undef ND
[-- Attachment #3 --]
Index: sbin/ifconfig/af_inet6.c
diff -u -p sbin/ifconfig/af_inet6.c.orig sbin/ifconfig/af_inet6.c
--- sbin/ifconfig/af_inet6.c.orig 2011-09-23 09:51:37.000000000 +0900
+++ sbin/ifconfig/af_inet6.c 2011-10-08 20:55:17.871353069 +0900
@@ -511,6 +511,8 @@ static struct cmd inet6_cmds[] = {
DEF_CMD("-prefer_source",-ND6_IFF_PREFER_SOURCE,setnd6flags),
DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
+ DEF_CMD("no_prefer_iface",ND6_IFF_NO_PREFER_IFACE,setnd6flags),
+ DEF_CMD("-no_prefer_iface",-ND6_IFF_NO_PREFER_IFACE,setnd6flags),
DEF_CMD_ARG("pltime", setip6pltime),
DEF_CMD_ARG("vltime", setip6vltime),
DEF_CMD("eui64", 0, setip6eui64),
Index: sbin/ifconfig/af_nd6.c
diff -u -p sbin/ifconfig/af_nd6.c.orig sbin/ifconfig/af_nd6.c
--- sbin/ifconfig/af_nd6.c.orig 2011-09-23 09:51:37.000000000 +0900
+++ sbin/ifconfig/af_nd6.c 2011-10-08 20:57:46.484522687 +0900
@@ -58,7 +58,7 @@ static const char rcsid[] =
#define MAX_SYSCTL_TRY 5
#define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \
"\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \
- "\007NO_RADR\020DEFAULTIF"
+ "\007NO_RADR\010NO_PREFER_IFACE\020DEFAULTIF"
static int isnd6defif(int);
void setnd6flags(const char *, int, int, const struct afswtch *);
Index: sbin/ifconfig/ifconfig.8
diff -u sbin/ifconfig/ifconfig.8.orig sbin/ifconfig/ifconfig.8
--- sbin/ifconfig/ifconfig.8.orig 2011-09-23 09:51:37.000000000 +0900
+++ sbin/ifconfig/ifconfig.8 2011-10-08 20:53:47.050796897 +0900
@@ -690,6 +690,13 @@
.It Cm -prefer_source
Clear a flag
.Cm prefer_source .
+.It Cm no_prefer_iface
+Set a flag to not prefer address on the interface as candidates of the
+source address for outgoing packets, even when the interface is
+outgoing interface.
+.It Cm -no_prefer_iface
+Clear a flag
+.Cm no_prefer_iface .
.El
.Pp
The following parameters are specific to cloning
[-- Attachment #4 --]
--
Hajimu UMEMOTO
ume@mahoroba.org ume@{,jp.}FreeBSD.org
http://www.mahoroba.org/~ume/
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygezk0ie72u.wl%ume>
