From: Florian Westphal Date: Wed, 27 Jul 2011 06:47:05 +0000 (+0000) Subject: tc: filter: fix default 'protocol all' on little-endian platforms X-Git-Tag: v3.0.0~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05fb9184f2129c50cd0e406e9eda80509307af25;p=thirdparty%2Fiproute2.git tc: filter: fix default 'protocol all' on little-endian platforms when specifiying filters without 'protocol' keyword, tc will default to 'protocol all'. Unfortunately, this missed a byte-ordering conversion. --- diff --git a/tc/tc_filter.c b/tc/tc_filter.c index 919c57c13..4e5581277 100644 --- a/tc/tc_filter.c +++ b/tc/tc_filter.c @@ -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) {