summaryrefslogtreecommitdiffstats
path: root/sys/net/if_llatbl.c
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2009-09-05 16:43:16 +0000
committerqingli <qingli@FreeBSD.org>2009-09-05 16:43:16 +0000
commit0cca60c70d1c3115577b3e8fa7f015d4d9eb8904 (patch)
treec3085c58ec7f99afbd953e6a54aeb378a9bdc66f /sys/net/if_llatbl.c
parent36333bfcba5bfd937fe1818b3b8ad16d334d48b5 (diff)
downloadFreeBSD-src-0cca60c70d1c3115577b3e8fa7f015d4d9eb8904.zip
FreeBSD-src-0cca60c70d1c3115577b3e8fa7f015d4d9eb8904.tar.gz
This patch fixes the following issues:
- Interface link-local address is not reachable within the node that owns the interface, this is due to the mismatch in address scope as the result of the installed interface address loopback route. Therefore for each interface address loopback route, the rt_gateway field (of AF_LINK type) will be used to track which interface a given address belongs to. This will aid the address source to use the proper interface for address scope/zone validation. - The loopback address is not reachable. The root cause is the same as the above. - Empty nd6 entries are created for the IPv6 loopback addresses only for validation reason. Doing so will eliminate as much of the special case (loopback addresses) handling code as possible, however, these empty nd6 entries should not be returned to the userland applications such as the "ndp" command. Since both of the above issues contain common files, these files are committed together. Reviewed by: bz MFC after: immediately
Diffstat (limited to 'sys/net/if_llatbl.c')
-rw-r--r--sys/net/if_llatbl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c
index b66d6e1..fb94f73 100644
--- a/sys/net/if_llatbl.c
+++ b/sys/net/if_llatbl.c
@@ -263,6 +263,15 @@ lla_rt_output(struct rt_msghdr *rtm, struct rt_addrinfo *info)
__func__, dl->sdl_index);
return EINVAL;
}
+ if (ifp->if_flags & IFF_LOOPBACK) {
+ struct ifaddr *ia;
+ ia = ifa_ifwithaddr(dst);
+ if (ia != NULL) {
+ ifp = ia->ifa_ifp;
+ ifa_free(ia);
+ } else
+ return EINVAL;
+ }
switch (rtm->rtm_type) {
case RTM_ADD:
OpenPOWER on IntegriCloud