From: Stephen Hemminger Date: Thu, 19 May 2011 16:19:17 +0000 (-0700) Subject: tc filter: fix dport/sport in pretty print output X-Git-Tag: v2.6.39~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcd7abddd4962f01f35eb644702c9abdf4c81d0e;p=thirdparty%2Fiproute2.git 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. --- diff --git a/tc/f_u32.c b/tc/f_u32.c index c77e9cc89..479b3f1bb 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);