Skip to contentSkip to conversation

tc: filter: fix default 'protocol all' on little-endian platforms

PATCH New Florian Westphal 1 participant 1 message Jul 27, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 tc/tc_filter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tc/tc_filter.c +1 -1
index 919c57c..4e55812 100644
@@ -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) {
Signature · 1 line
1.7.3.4