mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2026-01-26 14:13:24 +00:00
tc: nat: ffs should operation on host byte ordered data
In print_nat the mask length is calculated as len = ffs(sel->mask); len = len ? 33 - len : 0; The mask is stored in network byte order, it should be converted to host byte order before calculating first bit set. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
667817b4c3
commit
afbfd2f2b0
@ -156,7 +156,7 @@ print_nat(const struct action_util *au, FILE * f, struct rtattr *arg)
|
||||
}
|
||||
sel = RTA_DATA(tb[TCA_NAT_PARMS]);
|
||||
|
||||
len = ffs(sel->mask);
|
||||
len = ffs(ntohl(sel->mask));
|
||||
len = len ? 33 - len : 0;
|
||||
|
||||
print_string(PRINT_ANY, "direction", "%s",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user