diff options
author | qingli <qingli@FreeBSD.org> | 2009-07-27 17:08:06 +0000 |
---|---|---|
committer | qingli <qingli@FreeBSD.org> | 2009-07-27 17:08:06 +0000 |
commit | 8c1899d9347988f10f8675cc62ab08f26bb9f2d7 (patch) | |
tree | ba2ac82153b664af47ac11ce57edbca618088bf7 /sys/netinet6/in6.c | |
parent | da6cb6e20c0e16d77eafa2b88d2b87b5544b7107 (diff) | |
download | FreeBSD-src-8c1899d9347988f10f8675cc62ab08f26bb9f2d7.zip FreeBSD-src-8c1899d9347988f10f8675cc62ab08f26bb9f2d7.tar.gz |
This patch does the following:
- Allow loopback route to be installed for address assigned to
interface of IFF_POINTOPOINT type.
- Install loopback route for an IPv4 interface addreess when the
"useloopback" sysctl variable is enabled. Similarly, install
loopback route for an IPv6 interface address when the sysctl variable
"nd6_useloopback" is enabled. Deleting loopback routes for interface
addresses is unconditional in case these sysctl variables were
disabled after an interface address has been assigned.
Reviewed by: bz
Approved by: re
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 7100ff1..2a1f8d9 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1191,7 +1191,11 @@ in6_purgeaddr(struct ifaddr *ifa) ifa_ref(ifa0); IF_ADDR_UNLOCK(ifp); - if (!(ia->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + /* + * Remove the loopback route to the interface address. + * The check for the current setting of "nd6_useloopback" is not needed. + */ + if (!(ia->ia_ifp->if_flags & IFF_LOOPBACK)) { struct rt_addrinfo info; struct sockaddr_dl null_sdl; @@ -1773,7 +1777,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia, /* * add a loopback route to self */ - if (!(ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + if (V_nd6_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) { struct rt_addrinfo info; struct rtentry *rt = NULL; static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; |