aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorCraig Gallek <kraig@google.com>2016-02-10 11:50:38 -0500
committerDavid S. Miller <davem@davemloft.net>2016-02-11 03:54:14 -0500
commita583636a83ea383fd07517e5a7a2eedbc5d90fb1 (patch)
tree98ebf6de1532c7693c9b1026cf1a898070a9c344 /net/ipv6/tcp_ipv6.c
parentd9b3fca27385eafe61c3ca6feab6cb1e7dc77482 (diff)
inet: refactor inet[6]_lookup functions to take skb
This is a preliminary step to allow fast socket lookup of SO_REUSEPORT groups. Doing so with a BPF filter will require access to the skb in question. This change plumbs the skb (and offset to payload data) through the call stack to the listening socket lookup implementations where it will be used in a following patch. Signed-off-by: Craig Gallek <kraig@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index d72bcfb326d8..9977b6f19f2a 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -866,7 +866,8 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb)
866 * no RST generated if md5 hash doesn't match. 866 * no RST generated if md5 hash doesn't match.
867 */ 867 */
868 sk1 = inet6_lookup_listener(dev_net(skb_dst(skb)->dev), 868 sk1 = inet6_lookup_listener(dev_net(skb_dst(skb)->dev),
869 &tcp_hashinfo, &ipv6h->saddr, 869 &tcp_hashinfo, NULL, 0,
870 &ipv6h->saddr,
870 th->source, &ipv6h->daddr, 871 th->source, &ipv6h->daddr,
871 ntohs(th->source), tcp_v6_iif(skb)); 872 ntohs(th->source), tcp_v6_iif(skb));
872 if (!sk1) 873 if (!sk1)
@@ -1375,8 +1376,8 @@ static int tcp_v6_rcv(struct sk_buff *skb)
1375 hdr = ipv6_hdr(skb); 1376 hdr = ipv6_hdr(skb);
1376 1377
1377lookup: 1378lookup:
1378 sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest, 1379 sk = __inet6_lookup_skb(&tcp_hashinfo, skb, __tcp_hdrlen(th),
1379 inet6_iif(skb)); 1380 th->source, th->dest, inet6_iif(skb));
1380 if (!sk) 1381 if (!sk)
1381 goto no_tcp_socket; 1382 goto no_tcp_socket;
1382 1383
@@ -1500,6 +1501,7 @@ do_time_wait:
1500 struct sock *sk2; 1501 struct sock *sk2;
1501 1502
1502 sk2 = inet6_lookup_listener(dev_net(skb->dev), &tcp_hashinfo, 1503 sk2 = inet6_lookup_listener(dev_net(skb->dev), &tcp_hashinfo,
1504 skb, __tcp_hdrlen(th),
1503 &ipv6_hdr(skb)->saddr, th->source, 1505 &ipv6_hdr(skb)->saddr, th->source,
1504 &ipv6_hdr(skb)->daddr, 1506 &ipv6_hdr(skb)->daddr,
1505 ntohs(th->dest), tcp_v6_iif(skb)); 1507 ntohs(th->dest), tcp_v6_iif(skb));