Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2001 15:45:35 +0200
From:      Giorgos Keramidas <charon@labs.gr>
To:        current@FreeBSD.ORG
Subject:   [PATCH] making ipfilter/ipnat silent
Message-ID:  <20011030154535.A41047@hades.hell.gr>

next in thread | raw e-mail | index | archive | help

--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

According to PR conf/22937 ipfilter_program is used in rc.network with
`eval' to make it possible for someone to write:

    ipfilter_flags=">/dev/null"

to avoid seeing messages that ipfilter prints, intermixed with other
stuff from the rc scripts.  When trying to change the ipfilter code in
rc.network with Arjan, a few days back, we kept the `eval' bits there,
just in case someone already uses them.

I was thinking that fixing ipfilter & ipnat to not print messages
(unless an error occurs, of course).  The attached patch makes
ipf/ipnat print those messages only with the -v (verbose) option.

However, ipfilter is contrib/ stuff and I can see from the commits
that only imports have been done on this.  What do you guys think?
Does this look ok, for posting to ipfilter developers? (hello Darren :-)

-giorgos

--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.ipf-verbose"

Index: ipf.c
===================================================================
RCS file: /home/ncvs/src/contrib/ipfilter/ipf.c,v
retrieving revision 1.1.1.11
diff -2 -u -r1.1.1.11 ipf.c
--- ipf.c	28 Jul 2001 11:59:19 -0000	1.1.1.11
+++ ipf.c	29 Oct 2001 20:46:59 -0000
@@ -475,5 +475,5 @@
 	if (opendevice(ipfname) != -2 && ioctl(fd, SIOCSWAPA, &in) == -1)
 		perror("ioctl(SIOCSWAPA)");
-	else
+	else if (opts & OPT_VERBOSE)
 		printf("Set %d now inactive\n", in);
 }
@@ -486,5 +486,5 @@
 	if (opendevice(ipfname) != -2 && ioctl(fd, SIOCFRSYN, &frsyn) == -1)
 		perror("SIOCFRSYN");
-	else
+	else if (opts & OPT_VERBOSE)
 		printf("filter sync'd\n");
 }
Index: ipnat.c
===================================================================
RCS file: /home/ncvs/src/contrib/ipfilter/ipnat.c,v
retrieving revision 1.1.1.13
diff -2 -u -r1.1.1.13 ipnat.c
--- ipnat.c	28 Jul 2001 11:59:20 -0000	1.1.1.13
+++ ipnat.c	29 Oct 2001 20:46:59 -0000
@@ -442,5 +442,5 @@
 		if (!(opts & OPT_NODO) && ioctl(fd, SIOCIPFFL, &n) == -1)
 			perror("ioctl(SIOCFLNAT)");
-		else
+		else if (opts & OPT_VERBOSE)
 			printf("%d entries flushed from NAT table\n", n);
 	}
@@ -450,5 +450,5 @@
 		if (!(opts & OPT_NODO) && ioctl(fd, SIOCIPFFL, &n) == -1)
 			perror("ioctl(SIOCCNATL)");
-		else
+		else if (opts & OPT_VERBOSE)
 			printf("%d entries flushed from NAT list\n", n);
 	}

--d6Gm4EdcadzBjdND--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011030154535.A41047>