]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: filter: fix default 'protocol all' on little-endian platforms
authorFlorian Westphal <fw@strlen.de>
Wed, 27 Jul 2011 06:47:05 +0000 (06:47 +0000)
committerStephen Hemminger <shemminger@vyatta.com>
Wed, 31 Aug 2011 17:55:13 +0000 (10:55 -0700)
when specifiying filters without 'protocol' keyword, tc will
default to 'protocol all'.

Unfortunately, this missed a byte-ordering conversion.

tc/tc_filter.c

index 919c57c133681f0f066bcd3adb978feda719e118..4e55812774742c75a43183a852a107d28fc1de85 100644 (file)
@@ -73,7 +73,7 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv)
        req.t.tcm_family = AF_UNSPEC;
 
        if (cmd == RTM_NEWTFILTER && flags & NLM_F_CREATE)
-               protocol = ETH_P_ALL;
+               protocol = htons(ETH_P_ALL);
 
        while (argc > 0) {
                if (strcmp(*argv, "dev") == 0) {