summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ncpaddr.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-11-23 12:39:20 +0000
committerbrian <brian@FreeBSD.org>2001-11-23 12:39:20 +0000
commit274cbc8854c9327555f7a67d5661a6c6c7c4c2eb (patch)
treea907a3f8ebf9b85b0293769a8e8979148723d447 /usr.sbin/ppp/ncpaddr.c
parentd2d81413e2edf91cf5327d6bdb08b26fb9ac0e31 (diff)
downloadFreeBSD-src-274cbc8854c9327555f7a67d5661a6c6c7c4c2eb.zip
FreeBSD-src-274cbc8854c9327555f7a67d5661a6c6c7c4c2eb.tar.gz
Don't adjust_linklocal() when pulling a sockaddr out of an ncpaddr or
ncprange structure. Don't write() the netmask for IPv6 sockaddrs to the routing socket if the prefixlen is 128. It seems that messages written to the routing socket with the scopeid set for link local addresses are not understood. Instead, we have to put the scopeid in the 5th and 6th bytes of the address (see adjust_linklocal() in ncpaddr.c). I think this may be a bug in the KAME implementation - it should really understand both forms.
Diffstat (limited to 'usr.sbin/ppp/ncpaddr.c')
-rw-r--r--usr.sbin/ppp/ncpaddr.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ncpaddr.c b/usr.sbin/ppp/ncpaddr.c
index 64a917d..aa99bda 100644
--- a/usr.sbin/ppp/ncpaddr.c
+++ b/usr.sbin/ppp/ncpaddr.c
@@ -324,7 +324,6 @@ ncpaddr_getsa(const struct ncpaddr *addr, struct sockaddr_storage *host)
host6->sin6_family = AF_INET6;
host6->sin6_len = sizeof(*host6);
host6->sin6_addr = addr->ncpaddr_ip6addr;
- adjust_linklocal(host6);
break;
#endif
@@ -610,6 +609,21 @@ ncprange_sethost(struct ncprange *range, const struct ncpaddr *from)
}
int
+ncprange_ishost(const struct ncprange *range)
+{
+ switch (range->ncprange_family) {
+ case AF_INET:
+ return range->ncprange_ip4width == 32;
+#ifndef NOINET6
+ case AF_INET6:
+ return range->ncprange_ip6width == 128;
+#endif
+ }
+
+ return (0);
+}
+
+int
ncprange_setwidth(struct ncprange *range, int width)
{
switch (range->ncprange_family) {
@@ -733,7 +747,6 @@ ncprange_getsa(const struct ncprange *range, struct sockaddr_storage *host,
host6->sin6_family = AF_INET6;
host6->sin6_len = sizeof(*host6);
host6->sin6_addr = range->ncprange_ip6addr;
- adjust_linklocal(host6);
if (mask6) {
mask6->sin6_family = AF_INET6;
mask6->sin6_len = sizeof(*host6);
OpenPOWER on IntegriCloud