summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-07-12 01:16:17 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-07-12 01:16:17 +0000
commit4963458c15da03c9f2030e35686f4e93e271c3c4 (patch)
tree32f3172011bc4e7fc52c741543265803ae399a86 /usr.sbin
parent504900526e39c13650e7fe60809ecfc3ec86e1ac (diff)
rev 1.14
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. From ume FreeBSD
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ppp/ncpaddr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/ppp/ppp/ncpaddr.c b/usr.sbin/ppp/ppp/ncpaddr.c
index f99aa46004b..2d9d9fce3f3 100644
--- a/usr.sbin/ppp/ppp/ncpaddr.c
+++ b/usr.sbin/ppp/ppp/ncpaddr.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: ncpaddr.c,v 1.9 2005/07/11 23:05:48 brad Exp $
+ * $OpenBSD: ncpaddr.c,v 1.10 2005/07/12 01:16:16 brad Exp $
*/
#include <sys/types.h>
@@ -406,13 +406,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;
}