diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index be4a37cc03aa..e382f939fb53 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -3855,6 +3855,9 @@ setup_redir_proto(char *spool_buf, int len, errx(EX_DATAERR, "redirect_proto: buf is too small\n"); } +static void +show_nat(int ac, char **av); + static void print_nat_config(char *buf) { struct cfg_nat *n; @@ -4063,6 +4066,11 @@ config_nat(int ac, char **av) i = do_cmd(IP_FW_NAT_CFG, buf, off); 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); } static void @@ -6054,7 +6062,6 @@ show_nat(int ac, char **av) if (do_cmd(cmd, data, (uintptr_t)&nbytes) < 0) err(EX_OSERR, "getsockopt(IP_FW_GET_%s)", (cmd == IP_FW_NAT_GET_LOG) ? "LOG" : "CONFIG"); - printf("nbytes %b\n", nbytes); } if (nbytes == 0) exit(0);