summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ipv6cp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-08-16 02:01:05 +0000
committerbrian <brian@FreeBSD.org>2001-08-16 02:01:05 +0000
commit9311b9a0c6a95eb3d50f008413e9402f009fc9c2 (patch)
tree335ec6fcb40828e986dc81fcd542ae2daf394fae /usr.sbin/ppp/ipv6cp.c
parent435f044654f35938fd5c9737d37e646786365f27 (diff)
downloadFreeBSD-src-9311b9a0c6a95eb3d50f008413e9402f009fc9c2.zip
FreeBSD-src-9311b9a0c6a95eb3d50f008413e9402f009fc9c2.tar.gz
Specify the gateway address when updating the MTU and send/recv pipe
sizes on a route. IMHO this shouldn't be necessary (the destination & mask/prefixlen should be enough), but without it, the default route update under OpenBSD will fail. Thanks to: Russell T Hunt <alaric@MIT.EDU>
Diffstat (limited to 'usr.sbin/ppp/ipv6cp.c')
-rw-r--r--usr.sbin/ppp/ipv6cp.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/usr.sbin/ppp/ipv6cp.c b/usr.sbin/ppp/ipv6cp.c
index eb76465..6ec1485 100644
--- a/usr.sbin/ppp/ipv6cp.c
+++ b/usr.sbin/ppp/ipv6cp.c
@@ -115,7 +115,13 @@ ipcp_SetIPv6address(struct ipv6cp *ipv6cp, u_int32_t mytok, u_int32_t histok)
{
struct bundle *bundle = ipv6cp->fsm.bundle;
struct in6_addr myaddr, hisaddr;
- struct ncprange myrange, dst;
+ struct ncprange myrange;
+ struct sockaddr_storage ssdst, ssgw, ssmask;
+ struct sockaddr *sadst, *sagw, *samask;
+
+ sadst = (struct sockaddr *)&ssdst;
+ sagw = (struct sockaddr *)&ssgw;
+ samask = (struct sockaddr *)&ssmask;
memset(&myaddr, '\0', sizeof myaddr);
memset(&hisaddr, '\0', sizeof hisaddr);
@@ -141,8 +147,12 @@ ipcp_SetIPv6address(struct ipv6cp *ipv6cp, u_int32_t mytok, u_int32_t histok)
IFACE_CLEAR_ALIASES|IFACE_SYSTEM);
if (bundle->ncp.cfg.sendpipe > 0 || bundle->ncp.cfg.recvpipe > 0) {
- ncprange_sethost(&dst, &ipv6cp->hisaddr);
- rt_Update(bundle, &dst);
+ ncprange_getsa(&myrange, &ssgw, &ssmask);
+ if (ncpaddr_isset(&ipv6cp->hisaddr))
+ ncpaddr_getsa(&ipv6cp->hisaddr, &ssdst);
+ else
+ sadst = NULL;
+ rt_Update(bundle, sadst, sagw, samask);
}
if (Enabled(bundle, OPT_SROUTES))
OpenPOWER on IntegriCloud