]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
tc filter: fix dport/sport in pretty print output
authorStephen Hemminger <shemminger@vyatta.com>
Thu, 19 May 2011 16:19:17 +0000 (09:19 -0700)
committerStephen Hemminger <shemminger@vyatta.com>
Thu, 19 May 2011 16:19:17 +0000 (09:19 -0700)
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

index c77e9cc894d9334f65dcdc7b5ec8e62136af5284..479b3f1bb8587b256b81816773e7f763e8b9c3a7 100644 (file)
@@ -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);