From bcd7abddd4962f01f35eb644702c9abdf4c81d0e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 19 May 2011 09:19:17 -0700 Subject: [PATCH] tc filter: fix dport/sport in pretty print output Problem reported by Peter Lebbing on Debian. The decode of source and destination port filters in pretty print mode was backwards. --- tc/f_u32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tc/f_u32.c b/tc/f_u32.c index c77e9cc..479b3f1 100644 --- a/tc/f_u32.c +++ b/tc/f_u32.c @@ -860,15 +860,15 @@ static void print_ipv4(FILE *f, const struct tc_u32_key *key) case 20: switch (ntohl(key->mask)) { case 0x0000ffff: - fprintf(f, "\n match sport %u", + fprintf(f, "\n match dport %u", ntohl(key->val) & 0xffff); return; case 0xffff0000: - fprintf(f, "\n match dport %u", + fprintf(f, "\n match sport %u", ntohl(key->val) >> 16); return; case 0xffffffff: - fprintf(f, "\n match sport %u, match dport %u", + fprintf(f, "\n match dport %u, match sport %u", ntohl(key->val) & 0xffff, ntohl(key->val) >> 16); -- 2.39.2