summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2013-01-09 18:18:08 +0000
committerume <ume@FreeBSD.org>2013-01-09 18:18:08 +0000
commite33acd92c323d70e5d6df57f002fc99962711614 (patch)
treed47e3ff0e4eea1ed47efa711fb58f1061db36182 /sys/netinet6
parentdc876f51b7413aaa22e802a6b7fd911229c8f410 (diff)
downloadFreeBSD-src-e33acd92c323d70e5d6df57f002fc99962711614.zip
FreeBSD-src-e33acd92c323d70e5d6df57f002fc99962711614.tar.gz
Add no_prefer_iface option.
It stops treating the address on the interface as special by source address selection rule even when the interface is outgoing interface. This is desired in some situation. Requested by: hrs Reviewed by: IHANet folks including hrs MFC after: 1 week
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6_src.c10
-rw-r--r--sys/netinet6/nd6.h1
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index fb7e6f0..8d04c46 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -383,10 +383,12 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
*/
/* 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
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index 1655a6c..94202e1 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -86,6 +86,7 @@ struct nd_ifinfo {
#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
OpenPOWER on IntegriCloud