From owner-freebsd-current Tue Oct 30 12:46:25 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 3B4C737B405 for ; Tue, 30 Oct 2001 12:46:16 -0800 (PST) Received: from hades.hell.gr (patr530-a008.otenet.gr [212.205.215.8]) by mailsrv.otenet.gr (8.11.5/8.11.5) with ESMTP id f9UKkCG01916 for ; Tue, 30 Oct 2001 22:46:12 +0200 (EET) Received: (from charon@localhost) by hades.hell.gr (8.11.6/8.11.6) id f9UDjak41921 for current@freebsd.org; Tue, 30 Oct 2001 15:45:36 +0200 (EET) (envelope-from charon@labs.gr) Date: Tue, 30 Oct 2001 15:45:35 +0200 From: Giorgos Keramidas To: current@FreeBSD.ORG Subject: [PATCH] making ipfilter/ipnat silent Message-ID: <20011030154535.A41047@hades.hell.gr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --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