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>
This commit is contained in:

committed by
David S. Miller

parent
d9b3fca273
commit
a583636a83
@@ -357,18 +357,18 @@ struct sock *inet_diag_find_one_icsk(struct net *net,
|
||||
struct sock *sk;
|
||||
|
||||
if (req->sdiag_family == AF_INET)
|
||||
sk = inet_lookup(net, hashinfo, req->id.idiag_dst[0],
|
||||
sk = inet_lookup(net, hashinfo, NULL, 0, req->id.idiag_dst[0],
|
||||
req->id.idiag_dport, req->id.idiag_src[0],
|
||||
req->id.idiag_sport, req->id.idiag_if);
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
else if (req->sdiag_family == AF_INET6) {
|
||||
if (ipv6_addr_v4mapped((struct in6_addr *)req->id.idiag_dst) &&
|
||||
ipv6_addr_v4mapped((struct in6_addr *)req->id.idiag_src))
|
||||
sk = inet_lookup(net, hashinfo, req->id.idiag_dst[3],
|
||||
sk = inet_lookup(net, hashinfo, NULL, 0, req->id.idiag_dst[3],
|
||||
req->id.idiag_dport, req->id.idiag_src[3],
|
||||
req->id.idiag_sport, req->id.idiag_if);
|
||||
else
|
||||
sk = inet6_lookup(net, hashinfo,
|
||||
sk = inet6_lookup(net, hashinfo, NULL, 0,
|
||||
(struct in6_addr *)req->id.idiag_dst,
|
||||
req->id.idiag_dport,
|
||||
(struct in6_addr *)req->id.idiag_src,
|
||||
|
Reference in New Issue
Block a user