summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2003-04-04 11:09:08 +0000
committerume <ume@FreeBSD.org>2003-04-04 11:09:08 +0000
commiteb6d89b383f34f910b5e6119f4d794bd4733ba80 (patch)
tree7cbf54bcd1cb6a11cb0697650ea2a5597be961d4 /usr.sbin/ppp
parentdb5ec15123daf122ff48a5939b9b1a3d3a32abbf (diff)
downloadFreeBSD-src-eb6d89b383f34f910b5e6119f4d794bd4733ba80.zip
FreeBSD-src-eb6d89b383f34f910b5e6119f4d794bd4733ba80.tar.gz
Set link-local address of tun interface with prefixlen = 64
instead of 128. It makes RA happy. Reported by: rafa@dif.um.es, SHIRASAKI Yasuhiro <yasuhiro@nttv6.jp> Reviewed by: SHIRASAKI Yasuhiro <yasuhiro@nttv6.jp> MFC after: 1 week
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/iface.c14
-rw-r--r--usr.sbin/ppp/ipv6cp.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/ppp/iface.c b/usr.sbin/ppp/iface.c
index e29bf75..8a23742 100644
--- a/usr.sbin/ppp/iface.c
+++ b/usr.sbin/ppp/iface.c
@@ -83,6 +83,10 @@
#include "prompt.h"
#include "iface.h"
+#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}
+static const struct in6_addr in6mask128 = IN6MASK128;
+
struct iface *
iface_Create(const char *name)
@@ -333,7 +337,8 @@ iface_addr_Add(const char *name, struct iface_addr *addr, int s)
memcpy(&ifra6.ifra_prefixmask, &ssmsk, sizeof ifra6.ifra_prefixmask);
if (ncpaddr_family(&addr->peer) == AF_UNSPEC)
ifra6.ifra_dstaddr.sin6_family = AF_UNSPEC;
- else
+ else if (memcmp(&((struct sockaddr_in6 *)&ssmsk)->sin6_addr, &in6mask128,
+ sizeof in6mask128) == 0)
memcpy(&ifra6.ifra_dstaddr, &sspeer, sizeof ifra6.ifra_dstaddr);
ifra6.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
ifra6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
@@ -426,7 +431,7 @@ int
iface_Add(struct iface *iface, struct ncp *ncp, const struct ncprange *ifa,
const struct ncpaddr *peer, int how)
{
- int af, n, removed, s, width;
+ int af, n, removed, s;
struct ncpaddr ncplocal;
struct iface_addr *addr, newaddr;
@@ -452,11 +457,6 @@ iface_Add(struct iface *iface, struct ncp *ncp, const struct ncprange *ifa,
return 1; /* Already there */
}
- width =
-#ifndef NOINET6
- (af == AF_INET6) ? 128 :
-#endif
- 32;
removed = iface_addr_Zap(iface->name, iface->addr + n, s);
if (removed)
ncp_IfaceAddrDeleted(ncp, iface->addr + n);
diff --git a/usr.sbin/ppp/ipv6cp.c b/usr.sbin/ppp/ipv6cp.c
index 02c30bf..b126b0d 100644
--- a/usr.sbin/ppp/ipv6cp.c
+++ b/usr.sbin/ppp/ipv6cp.c
@@ -224,7 +224,7 @@ ipcp_SetIPv6address(struct ipv6cp *ipv6cp, u_char *myifid, u_char *hisifid)
ncpaddr_setip6(&ipv6cp->myaddr, &myaddr);
ncpaddr_setip6(&ipv6cp->hisaddr, &hisaddr);
- ncprange_sethost(&myrange, &ipv6cp->myaddr);
+ ncprange_set(&myrange, &ipv6cp->myaddr, 64);
if (!iface_Add(bundle->iface, &bundle->ncp, &myrange, &ipv6cp->hisaddr,
IFACE_ADD_FIRST|IFACE_FORCE_ADD|IFACE_SYSTEM))
OpenPOWER on IntegriCloud