From 405991437d236c72722d3bba24fd0965feed2cbd Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 9 May 1999 16:05:35 +0000 Subject: [PATCH] Adjust for dot_quad_addr() changes --- usr.sbin/tcpdchk/scaffold.c | 6 +++--- usr.sbin/tcpdchk/tcpdchk.c | 9 +++++---- usr.sbin/tcpdmatch/tcpdmatch.c | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/usr.sbin/tcpdchk/scaffold.c b/usr.sbin/tcpdchk/scaffold.c index dc871b88c8d5..890566c03f21 100644 --- a/usr.sbin/tcpdchk/scaffold.c +++ b/usr.sbin/tcpdchk/scaffold.c @@ -1,4 +1,4 @@ -/* $NetBSD: scaffold.c,v 1.3 1997/11/16 21:30:25 christos Exp $ */ +/* $NetBSD: scaffold.c,v 1.4 1999/05/09 16:05:35 christos Exp $ */ /* * Routines for testing only. Not really industrial strength. @@ -11,7 +11,7 @@ #if 0 static char sccs_id[] = "@(#) scaffold.c 1.5 95/01/03 09:13:48"; #else -__RCSID("$NetBSD: scaffold.c,v 1.3 1997/11/16 21:30:25 christos Exp $"); +__RCSID("$NetBSD: scaffold.c,v 1.4 1999/05/09 16:05:35 christos Exp $"); #endif #endif @@ -95,7 +95,7 @@ char *host; /* * Host address: translate it to internal form. */ - if ((addr.s_addr = dot_quad_addr(host)) != INADDR_NONE) { + if (dot_quad_addr(host, &addr) == 0) { h.h_addr_list = addr_list; h.h_addr_list[0] = (char *) &addr; h.h_length = sizeof(addr); diff --git a/usr.sbin/tcpdchk/tcpdchk.c b/usr.sbin/tcpdchk/tcpdchk.c index 53939b36f733..34f52001734e 100644 --- a/usr.sbin/tcpdchk/tcpdchk.c +++ b/usr.sbin/tcpdchk/tcpdchk.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcpdchk.c,v 1.5 1999/01/18 18:01:26 christos Exp $ */ +/* $NetBSD: tcpdchk.c,v 1.6 1999/05/09 16:05:35 christos Exp $ */ /* * tcpdchk - examine all tcpd access control rules and inetd.conf entries @@ -21,7 +21,7 @@ #if 0 static char sccsid[] = "@(#) tcpdchk.c 1.7 96/02/11 17:01:34"; #else -__RCSID("$NetBSD: tcpdchk.c,v 1.5 1999/01/18 18:01:26 christos Exp $"); +__RCSID("$NetBSD: tcpdchk.c,v 1.6 1999/05/09 16:05:35 christos Exp $"); #endif #endif @@ -421,6 +421,7 @@ char *pat; { char *mask; int addr_count = 1; + struct in_addr dummy; if (pat[0] == '@') { /* @netgroup */ #ifdef NO_NETGRENT @@ -440,8 +441,8 @@ char *pat; #endif #endif } else if ((mask = split_at(pat, '/')) != NULL) { /* network/netmask */ - if (dot_quad_addr(pat) == INADDR_NONE - || dot_quad_addr(mask) == INADDR_NONE) + if (dot_quad_addr(pat, &dummy) != 0 + || dot_quad_addr(mask, &dummy) != 0) tcpd_warn("%s/%s: bad net/mask pattern", pat, mask); } else if (STR_EQ(pat, "FAIL")) { /* obsolete */ tcpd_warn("FAIL is no longer recognized"); diff --git a/usr.sbin/tcpdmatch/tcpdmatch.c b/usr.sbin/tcpdmatch/tcpdmatch.c index df492e01aadf..c32d5d4a4de1 100644 --- a/usr.sbin/tcpdmatch/tcpdmatch.c +++ b/usr.sbin/tcpdmatch/tcpdmatch.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcpdmatch.c,v 1.4 1998/03/05 18:23:31 christos Exp $ */ +/* $NetBSD: tcpdmatch.c,v 1.5 1999/05/09 16:06:33 christos Exp $ */ /* * tcpdmatch - explain what tcpd would do in a specific case @@ -20,7 +20,7 @@ #if 0 static char sccsid[] = "@(#) tcpdmatch.c 1.5 96/02/11 17:01:36"; #else -__RCSID("$NetBSD: tcpdmatch.c,v 1.4 1998/03/05 18:23:31 christos Exp $"); +__RCSID("$NetBSD: tcpdmatch.c,v 1.5 1999/05/09 16:06:33 christos Exp $"); #endif #endif @@ -210,7 +210,7 @@ char **argv; * If a client address is specified, we simulate the effect of client * hostname lookup failure. */ - if (dot_quad_addr(client) != INADDR_NONE) { + if (dot_quad_addr(client, NULL) == 0) { request_set(&request, RQ_CLIENT_ADDR, client, 0); tcpdmatch(&request); exit(0);