Prechádzať zdrojové kódy

tcp: Fix bug in tcp socket early demux

The dest port for the call to __inet_lookup_established() in TCP early demux
code is passed with the wrong endian-ness. This causes the lookup to fail
leading to early demux not being used.

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vijay Subramanian 13 rokov pred
rodič
commit
7011d0851b
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      net/ipv4/tcp_ipv4.c

+ 1 - 1
net/ipv4/tcp_ipv4.c

@@ -1701,7 +1701,7 @@ int tcp_v4_early_demux(struct sk_buff *skb)
 	dev = skb->dev;
 	sk = __inet_lookup_established(net, &tcp_hashinfo,
 				       iph->saddr, th->source,
-				       iph->daddr, th->dest,
+				       iph->daddr, ntohs(th->dest),
 				       dev->ifindex);
 	if (sk) {
 		skb->sk = sk;