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 c77e9cc..479b3f1 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -860,15 +860,15 @@
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);