netfilter: nat: fix icmp id endianness when protocol mapping was given
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: nat: fix icmp id endianness when protocol mapping was given
net/netfilter/nf_nat_core.c:422:29: sparse: incorrect type in assignment (different base types)net/netfilter/nf_nat_core.c:422:29: expected unsigned int [unsigned] [assigned] minnet/netfilter/nf_nat_core.c:422:29: got restricted __be16 const [usertype] id
The warning is correct, this needs ntohs treatment.
---
Pablo, feel free to squash this with commit 57be8a51f2a8ba390f7c5a03d2ae812a1b39c9bb ("netfilter: nat: fix icmp id randomization"), it touched this area already (and moved the faulty line to its current place).
net/netfilter/nf_nat_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_nat_core.c +1 -1
@@ -419,7 +419,7 @@ static void nf_nat_l4proto_unique_tuple(struct nf_conntrack_tuple *tuple, min =0 ; range_size =65536 ; }else { - min = range->min_proto.icmp.id; + min =ntohs (range->min_proto.icmp.id); range_size =ntohs (range->max_proto.icmp.id) -ntohs (range->min_proto.icmp.id) +1 ; }
Signature · 1 line
2.21.0
Pablo Neira Ayuso
maintainerQuoted 6 lines · Florian Westphal
net/netfilter/nf_nat_core.c:422:29: sparse: incorrect type in assignment (different base types)net/netfilter/nf_nat_core.c:422:29: expected unsigned int [unsigned] [assigned] minnet/netfilter/nf_nat_core.c:422:29: got restricted__be16const [usertype] idThe warning is correct, this needs ntohs treatment.
Quoted 7 lines
Reported-by kbuild test robot <[email protected]>Fixes 203f2e78200c27e ("netfilter: nat: remove l4proto->unique_tuple")Signed-off-by Florian Westphal <[email protected]>---
Pablo, feel free to squash this with commit57be8a51f2a8ba390f7c5a03d2ae812a1b39c9bb("netfilter: nat: fix icmp id randomization"), it touched this area already (and moved the faulty line to its current place).
I have collapsed it as suggested. Thanks.