aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorKOVACS Krisztian <hidden@sch.bme.hu>2008-10-07 15:38:32 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-07 15:38:32 -0400
commit607c4aaf03041c8bd81555a0218050c0f895088e (patch)
tree130cfcfca74eccb135592a883000a319e94cd7e2 /net/ipv6/udp.c
parent9a1f27c48065ce713eb47f2fd475b717e63ef239 (diff)
inet: Add udplib_lookup_skb() helpers
To be able to use the cached socket reference in the skb during input processing we add a new set of lookup functions that receive the skb on their argument list. Signed-off-by: KOVACS Krisztian <hidden@sch.bme.hu> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c14
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
110static 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))