netfilter: conntrack: fix bogus port values for other l4 protocols
authorFlorian Westphal <fw@strlen.de>
Mon, 21 Jan 2019 13:46:48 +0000 (14:46 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 22 Jan 2019 22:28:40 +0000 (23:28 +0100)
commite2f7cc72cbf42e037229d8bd998966569662442f
tree69fba307277db59405aed97a44ec91556d6944b9
parent81e01647fd2c6dcd592c4a005f47ba9ed5a52847
netfilter: conntrack: fix bogus port values for other l4 protocols

We must only extract l4 proto information if we can track the layer 4
protocol.

Before removal of pkt_to_tuple callback, the code to extract port
information was only reached for TCP/UDP/LITE/DCCP/SCTP.

The other protocols were handled by the indirect call, and the
'generic' tracker took care of other protocols that have no notion
of 'ports'.

After removal of the callback we must be more strict here and only
init port numbers for those protocols that have ports.

Fixes: df5e1629087a ("netfilter: conntrack: remove pkt_to_tuple callback")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_core.c