From 657714f28b4882b431d947e9e54ff90261a40375 Mon Sep 17 00:00:00 2001 From: brian Date: Wed, 29 Mar 2000 09:31:27 +0000 Subject: Allow the use of hostnames instead of (and as well as) IP numbers in all commands. If people use hostnames and have dodgy resolvers or try to resolve the hostname before the link is up, they get what they deserve.... Requested by: ru --- usr.sbin/ppp/filter.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.sbin/ppp/filter.c') diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c index 6e6f5f9..8fca40f 100644 --- a/usr.sbin/ppp/filter.c +++ b/usr.sbin/ppp/filter.c @@ -106,13 +106,14 @@ ParseAddr(struct ipcp *ipcp, const char *data, *paddr = ipcp->ns.dns[0]; else if (ipcp && strncasecmp(data, "DNS1", len) == 0) *paddr = ipcp->ns.dns[1]; - else if (len > 15) - log_Printf(LogWARN, "ParseAddr: %s: Bad address\n", data); else { - char s[16]; + char *s; + + s = (char *)alloca(len + 1); strncpy(s, data, len); s[len] = '\0'; - if (inet_aton(s, paddr) == 0) { + *paddr = GetIpAddr(s); + if (paddr->s_addr == INADDR_ANY || paddr->s_addr == INADDR_NONE) { log_Printf(LogWARN, "ParseAddr: %s: Bad address\n", s); return 0; } -- cgit v1.1