diff options
-rw-r--r-- | usr.sbin/ppp/command.c | 7 | ||||
-rw-r--r-- | usr.sbin/ppp/ncpaddr.c | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 2f2643b7bad1..2d8fc9cf4d23 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -2397,6 +2397,9 @@ AddCommand(struct cmdargs const *arg) struct ncpaddr gw; struct ncprange dest; struct in_addr host; +#ifndef NOINET6 + struct in6_addr host6; +#endif int dest_default, gw_arg, addrs; if (arg->argc != arg->argn+3 && arg->argc != arg->argn+2) @@ -2454,7 +2457,9 @@ AddCommand(struct cmdargs const *arg) addrs |= ROUTE_GWHISADDR; #ifndef NOINET6 } else if (strcasecmp(arg->argv[arg->argn + gw_arg], "HISADDR6") == 0) { - ncpaddr_copy(&gw, &arg->bundle->ncp.ipv6cp.hisaddr); + if (!ncpaddr_getip6(&arg->bundle->ncp.ipv6cp.hisaddr, &host6)) + memset(&host6, '\0', sizeof host6); + ncpaddr_setip6(&gw, &host6); addrs |= ROUTE_GWHISADDR6; #endif } else { diff --git a/usr.sbin/ppp/ncpaddr.c b/usr.sbin/ppp/ncpaddr.c index 5b19d2589cf1..1f84f922fdff 100644 --- a/usr.sbin/ppp/ncpaddr.c +++ b/usr.sbin/ppp/ncpaddr.c @@ -917,7 +917,9 @@ ncprange_aton(struct ncprange *range, struct ncp *ncp, const char *data) return 1; #ifndef NOINET6 } else if (ncp && strncasecmp(data, "HISADDR6", len) == 0) { - ncprange_sethost(range, &ncp->ipv6cp.hisaddr); + range->ncprange_family = AF_INET6; + range->ncprange_ip6addr = ncp->ipv6cp.hisaddr.ncpaddr_ip6addr; + range->ncprange_ip6width = 128; return 1; #endif } else if (ncp && strncasecmp(data, "MYADDR", len) == 0) { @@ -928,7 +930,9 @@ ncprange_aton(struct ncprange *range, struct ncp *ncp, const char *data) return 1; #ifndef NOINET6 } else if (ncp && strncasecmp(data, "MYADDR6", len) == 0) { - ncprange_sethost(range, &ncp->ipv6cp.myaddr); + range->ncprange_family = AF_INET6; + range->ncprange_ip6addr = ncp->ipv6cp.myaddr.ncpaddr_ip6addr; + range->ncprange_ip6width = 128; return 1; #endif } else if (ncp && strncasecmp(data, "DNS0", len) == 0) { |