diff options
author | hrs <hrs@FreeBSD.org> | 2014-08-20 17:27:15 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2014-08-20 17:27:15 +0000 |
commit | aff80f6238de174815e522519141d730687e3be9 (patch) | |
tree | 5633789fc052a6d2b96f763b6704f8f4cd537358 /usr.sbin | |
parent | e28f5c3fbc2c8d89f41becf1ce551c7b41531320 (diff) | |
download | FreeBSD-src-aff80f6238de174815e522519141d730687e3be9.zip FreeBSD-src-aff80f6238de174815e522519141d730687e3be9.tar.gz |
Recover sin6_scope_id of gateway addresses in riprecv() by using the if_index
where a RIP packet was received. This fixes a bug which prevented gateway
addresses in fe80::/64 from being added.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/route6d/route6d.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index fc45615..258219b 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -2835,6 +2835,8 @@ addroute(struct riprt *rrt, sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_family = AF_INET6; sin6->sin6_addr = *gw; + if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + sin6->sin6_scope_id = ifcp->ifc_index; sin6 = (struct sockaddr_in6 *)((char *)sin6 + ROUNDUP(sin6->sin6_len)); /* Netmask */ sin6->sin6_len = sizeof(struct sockaddr_in6); |