From 55e2d46c54bc6ebb32b63c779e6239c12e888c0d Mon Sep 17 00:00:00 2001 From: Paolo Pisati Date: Thu, 8 Jan 2009 22:32:35 +0000 Subject: MFC r186297 and r186298: Honor the quiet (-q) option while adding a nat rule. --- sbin/ipfw/ipfw.8 | 2 ++ sbin/ipfw/ipfw2.c | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index bffcfe736d5c..d9c262cd2550 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -65,6 +65,7 @@ .Op Ar number ... .Pp .Nm +.Op Fl q .Cm nat .Ar number .Cm config @@ -231,6 +232,7 @@ Try to resolve addresses and service names in output. .It Fl q While .Cm add Ns ing , +.Cm nat Ns ing , .Cm zero Ns ing , .Cm resetlog Ns ging or diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 70dd8c0a068b..59f9d691500e 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -4067,10 +4067,12 @@ config_nat(int ac, char **av) if (i) err(1, "setsockopt(%s)", "IP_FW_NAT_CFG"); - /* After every modification, we show the resultant rule. */ - int _ac = 3; - char *_av[] = {"show", "config", id}; - show_nat(_ac, _av); + if (!do_quiet) { + /* After every modification, we show the resultant rule. */ + int _ac = 3; + char *_av[] = {"show", "config", id}; + show_nat(_ac, _av); + } } static void -- cgit v1.3