path: root/net/ipv4/tcp_ipv4.c
diff options
authorPaolo Abeni <pabeni@redhat.com>2017-09-28 15:51:36 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-01 03:55:47 +0100
commit7487449c86c65202b3b725c4524cb48dd65e4e6f (patch)
tree4adea181ccd96b769cf011bad6312fe6e07543b3 /net/ipv4/tcp_ipv4.c
parentip6_tunnel: update mtu properly for ARPHRD_ETHER tunnel device in tx path (diff)
IPv4: early demux can return an error code
Currently no error is emitted, but this infrastructure will used by the next patch to allow source address validation for mcast sockets. Since early demux can do a route lookup and an ipv4 route lookup can return an error code this is consistent with the current ipv4 route infrastructure. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index d9416b5162bc..85164d4d3e53 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1503,23 +1503,23 @@ csum_err:
-void tcp_v4_early_demux(struct sk_buff *skb)
+int tcp_v4_early_demux(struct sk_buff *skb)
const struct iphdr *iph;
const struct tcphdr *th;
struct sock *sk;
if (skb->pkt_type != PACKET_HOST)
- return;
+ return 0;
if (!pskb_may_pull(skb, skb_transport_offset(skb) + sizeof(struct tcphdr)))
- return;
+ return 0;
iph = ip_hdr(skb);
th = tcp_hdr(skb);
if (th->doff < sizeof(struct tcphdr) / 4)
- return;
+ return 0;
sk = __inet_lookup_established(dev_net(skb->dev), &tcp_hashinfo,
iph->saddr, th->source,
@@ -1538,6 +1538,7 @@ void tcp_v4_early_demux(struct sk_buff *skb)
skb_dst_set_noref(skb, dst);
+ return 0;
bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)