From cea9f71f5618250a38acb21c31fbbf93a752f7d4 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 9 Dec 2008 15:06:20 +0100 Subject: iptables-save: output ! in position according to manpage Signed-off-by: Jan Engelhardt Signed-off-by: Patrick McHardy --- extensions/libxt_dscp.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'extensions/libxt_dscp.c') diff --git a/extensions/libxt_dscp.c b/extensions/libxt_dscp.c index 307d8009..eefb186b 100644 --- a/extensions/libxt_dscp.c +++ b/extensions/libxt_dscp.c @@ -115,22 +115,12 @@ static void dscp_check(unsigned int flags) "DSCP match: Parameter --dscp is required"); } -static void -print_dscp(u_int8_t dscp, int invert, int numeric) -{ - if (invert) - printf("! "); - - printf("0x%02x ", dscp); -} - static void dscp_print(const void *ip, const struct xt_entry_match *match, int numeric) { const struct xt_dscp_info *dinfo = (const struct xt_dscp_info *)match->data; - printf("DSCP match "); - print_dscp(dinfo->dscp, dinfo->invert, numeric); + printf("DSCP match %s0x%02x", dinfo->invert ? "!" : "", dinfo->dscp); } static void dscp_save(const void *ip, const struct xt_entry_match *match) @@ -138,8 +128,7 @@ static void dscp_save(const void *ip, const struct xt_entry_match *match) const struct xt_dscp_info *dinfo = (const struct xt_dscp_info *)match->data; - printf("--dscp "); - print_dscp(dinfo->dscp, dinfo->invert, 1); + printf("%s--dscp 0x%02x ", dinfo->invert ? "! " : "", dinfo->dscp); } static struct xtables_match dscp_match = { -- cgit v1.2.3