diff options
Diffstat (limited to 'include/net/inet6_hashtables.h')
-rw-r--r-- | include/net/inet6_hashtables.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 995efbb031a..f74665d7bea 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -96,10 +96,14 @@ static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo, | |||
96 | const __be16 sport, | 96 | const __be16 sport, |
97 | const __be16 dport) | 97 | const __be16 dport) |
98 | { | 98 | { |
99 | return __inet6_lookup(dev_net(skb->dst->dev), hashinfo, | 99 | struct sock *sk; |
100 | &ipv6_hdr(skb)->saddr, sport, | 100 | |
101 | &ipv6_hdr(skb)->daddr, ntohs(dport), | 101 | if (unlikely(sk = skb_steal_sock(skb))) |
102 | inet6_iif(skb)); | 102 | return sk; |
103 | else return __inet6_lookup(dev_net(skb->dst->dev), hashinfo, | ||
104 | &ipv6_hdr(skb)->saddr, sport, | ||
105 | &ipv6_hdr(skb)->daddr, ntohs(dport), | ||
106 | inet6_iif(skb)); | ||
103 | } | 107 | } |
104 | 108 | ||
105 | extern struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, | 109 | extern struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, |