diff options
author | brian <brian@FreeBSD.org> | 2001-08-16 02:01:05 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-08-16 02:01:05 +0000 |
commit | 9311b9a0c6a95eb3d50f008413e9402f009fc9c2 (patch) | |
tree | 335ec6fcb40828e986dc81fcd542ae2daf394fae /usr.sbin/ppp/ipcp.c | |
parent | 435f044654f35938fd5c9737d37e646786365f27 (diff) | |
download | FreeBSD-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/ipcp.c')
-rw-r--r-- | usr.sbin/ppp/ipcp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c index 8decdb1..37c7e93 100644 --- a/usr.sbin/ppp/ipcp.c +++ b/usr.sbin/ppp/ipcp.c @@ -659,8 +659,14 @@ ipcp_SetIPaddress(struct ipcp *ipcp, struct in_addr myaddr, { struct bundle *bundle = ipcp->fsm.bundle; struct ncpaddr myncpaddr, hisncpaddr; - struct ncprange myrange, dst; + struct ncprange myrange; struct in_addr mask; + struct sockaddr_storage ssdst, ssgw, ssmask; + struct sockaddr *sadst, *sagw, *samask; + + sadst = (struct sockaddr *)&ssdst; + sagw = (struct sockaddr *)&ssgw; + samask = (struct sockaddr *)&ssmask; ncpaddr_setip4(&hisncpaddr, hisaddr); ncpaddr_setip4(&myncpaddr, myaddr); @@ -681,8 +687,9 @@ ipcp_SetIPaddress(struct ipcp *ipcp, struct in_addr myaddr, IFACE_CLEAR_ALIASES|IFACE_SYSTEM); if (bundle->ncp.cfg.sendpipe > 0 || bundle->ncp.cfg.recvpipe > 0) { - ncprange_sethost(&dst, &hisncpaddr); - rt_Update(bundle, &dst); + ncprange_getsa(&myrange, &ssgw, &ssmask); + ncpaddr_getsa(&hisncpaddr, &ssdst); + rt_Update(bundle, sadst, sagw, samask); } if (Enabled(bundle, OPT_SROUTES)) |