Though manpage says that 0.0.0.0 can be used as HISADDR for gw

in Framed-Route, it didn't work.  Since ncprange_aton() treats
0.0.0.0 and :: as prefixlen=0, we need to care the case.

MFC after:	1 week
This commit is contained in:
ume 2003-06-21 10:14:52 +00:00
parent 5a6a8f9b1c
commit f5eec6c857

View File

@ -418,13 +418,15 @@ ncpaddr_aton(struct ncpaddr *addr, struct ncp *ncp, const char *data)
if (!ncprange_aton(&range, ncp, data))
return 0;
if (range.ncprange_family == AF_INET && range.ncprange_ip4width != 32) {
if (range.ncprange_family == AF_INET && range.ncprange_ip4width != 32 &&
range.ncprange_ip4addr.s_addr != INADDR_ANY) {
log_Printf(LogWARN, "ncpaddr_aton: %s: Only 32 bits allowed\n", data);
return 0;
}
#ifndef NOINET6
if (range.ncprange_family == AF_INET6 && range.ncprange_ip6width != 128) {
if (range.ncprange_family == AF_INET6 && range.ncprange_ip6width != 128 &&
!IN6_IS_ADDR_UNSPECIFIED(&range.ncprange_ip6addr)) {
log_Printf(LogWARN, "ncpaddr_aton: %s: Only 128 bits allowed\n", data);
return 0;
}