* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: filter.c,v 1.13 2000/03/19 10:33:33 brian Exp $
+ * $OpenBSD: filter.c,v 1.14 2000/03/29 09:32:26 brian Exp $
*
* TODO: Should send ICMP error message when we discard packets.
*/
*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;
}