16c16
< * $FreeBSD: head/contrib/tcp_wrappers/tcpdchk.c 51495 1999-09-21 09:09:57Z sheldonh $
---
> * $FreeBSD: head/contrib/tcp_wrappers/tcpdchk.c 56977 2000-02-03 10:27:03Z shin $
26a27,29
> #ifdef INET6
> #include <sys/socket.h>
> #endif
405a409,428
> #ifdef INET6
> static int is_inet6_addr(pat)
> char *pat;
> {
> struct in6_addr addr;
> int len, ret;
> char ch;
>
> if (*pat != '[')
> return (0);
> len = strlen(pat);
> if ((ch = pat[len - 1]) != ']')
> return (0);
> pat[len - 1] = '\0';
> ret = inet_pton(AF_INET6, pat + 1, &addr);
> pat[len - 1] = ch;
> return (ret == 1);
> }
> #endif
>
451a475,482
> #ifdef INET6
> int mask_len;
>
> if ((dot_quad_addr(pat) == INADDR_NONE
> || dot_quad_addr(mask) == INADDR_NONE)
> && (!is_inet6_addr(pat)
> || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
> #else
453a485
> #endif
459a492,495
> #ifdef INET6
> } else if (is_inet6_addr(pat)) { /* IPv6 address */
> addr_count = 1;
> #endif
< * $FreeBSD: head/contrib/tcp_wrappers/tcpdchk.c 51495 1999-09-21 09:09:57Z sheldonh $
---
> * $FreeBSD: head/contrib/tcp_wrappers/tcpdchk.c 56977 2000-02-03 10:27:03Z shin $
26a27,29
> #ifdef INET6
> #include <sys/socket.h>
> #endif
405a409,428
> #ifdef INET6
> static int is_inet6_addr(pat)
> char *pat;
> {
> struct in6_addr addr;
> int len, ret;
> char ch;
>
> if (*pat != '[')
> return (0);
> len = strlen(pat);
> if ((ch = pat[len - 1]) != ']')
> return (0);
> pat[len - 1] = '\0';
> ret = inet_pton(AF_INET6, pat + 1, &addr);
> pat[len - 1] = ch;
> return (ret == 1);
> }
> #endif
>
451a475,482
> #ifdef INET6
> int mask_len;
>
> if ((dot_quad_addr(pat) == INADDR_NONE
> || dot_quad_addr(mask) == INADDR_NONE)
> && (!is_inet6_addr(pat)
> || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
> #else
453a485
> #endif
459a492,495
> #ifdef INET6
> } else if (is_inet6_addr(pat)) { /* IPv6 address */
> addr_count = 1;
> #endif