diff options
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r-- | net/ipv6/udp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index a6aecf76a71b..ce26c41d157d 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -107,6 +107,17 @@ static struct sock *__udp6_lib_lookup(struct net *net, | |||
107 | return result; | 107 | return result; |
108 | } | 108 | } |
109 | 109 | ||
110 | static struct sock *__udp6_lib_lookup_skb(struct sk_buff *skb, | ||
111 | __be16 sport, __be16 dport, | ||
112 | struct hlist_head udptable[]) | ||
113 | { | ||
114 | struct ipv6hdr *iph = ipv6_hdr(skb); | ||
115 | |||
116 | return __udp6_lib_lookup(dev_net(skb->dst->dev), &iph->saddr, sport, | ||
117 | &iph->daddr, dport, inet6_iif(skb), | ||
118 | udptable); | ||
119 | } | ||
120 | |||
110 | /* | 121 | /* |
111 | * This should be easy, if there is something there we | 122 | * This should be easy, if there is something there we |
112 | * return it, otherwise we block. | 123 | * return it, otherwise we block. |
@@ -488,8 +499,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[], | |||
488 | * check socket cache ... must talk to Alan about his plans | 499 | * check socket cache ... must talk to Alan about his plans |
489 | * for sock caches... i'll skip this for now. | 500 | * for sock caches... i'll skip this for now. |
490 | */ | 501 | */ |
491 | sk = __udp6_lib_lookup(net, saddr, uh->source, | 502 | sk = __udp6_lib_lookup_skb(skb, uh->source, uh->dest, udptable); |
492 | daddr, uh->dest, inet6_iif(skb), udptable); | ||
493 | 503 | ||
494 | if (sk == NULL) { | 504 | if (sk == NULL) { |
495 | if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) | 505 | if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) |