Don't install wrong IPv6 route by add command.
This commit is contained in:
parent
24e75d3601
commit
19228f1dbe
@ -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 {
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user