diff options
author | brian <brian@FreeBSD.org> | 2000-03-29 09:31:27 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-03-29 09:31:27 +0000 |
commit | 657714f28b4882b431d947e9e54ff90261a40375 (patch) | |
tree | 42ff94f251f125f12869396f6db814cfed469dea /usr.sbin/ppp/filter.c | |
parent | 675df45f337be72f224653e89e1c6560c4af879a (diff) | |
download | FreeBSD-src-657714f28b4882b431d947e9e54ff90261a40375.zip FreeBSD-src-657714f28b4882b431d947e9e54ff90261a40375.tar.gz |
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
Diffstat (limited to 'usr.sbin/ppp/filter.c')
-rw-r--r-- | usr.sbin/ppp/filter.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; } |