提交 b9901a84 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[NETNS][DCCPV4]: Make per-net socket lookup.

The inet_lookup family of functions requires a net to lookup
a socket in, so give a proper one to them.
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Acked-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f5487398
...@@ -211,8 +211,9 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) ...@@ -211,8 +211,9 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
return; return;
} }
sk = inet_lookup(&init_net, &dccp_hashinfo, iph->daddr, dh->dccph_dport, sk = inet_lookup(dev_net(skb->dev), &dccp_hashinfo,
iph->saddr, dh->dccph_sport, inet_iif(skb)); iph->daddr, dh->dccph_dport,
iph->saddr, dh->dccph_sport, inet_iif(skb));
if (sk == NULL) { if (sk == NULL) {
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS); ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
return; return;
...@@ -429,7 +430,7 @@ static struct sock *dccp_v4_hnd_req(struct sock *sk, struct sk_buff *skb) ...@@ -429,7 +430,7 @@ static struct sock *dccp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
if (req != NULL) if (req != NULL)
return dccp_check_req(sk, skb, req, prev); return dccp_check_req(sk, skb, req, prev);
nsk = inet_lookup_established(&init_net, &dccp_hashinfo, nsk = inet_lookup_established(sock_net(sk), &dccp_hashinfo,
iph->saddr, dh->dccph_sport, iph->saddr, dh->dccph_sport,
iph->daddr, dh->dccph_dport, iph->daddr, dh->dccph_dport,
inet_iif(skb)); inet_iif(skb));
...@@ -810,7 +811,7 @@ static int dccp_v4_rcv(struct sk_buff *skb) ...@@ -810,7 +811,7 @@ static int dccp_v4_rcv(struct sk_buff *skb)
/* Step 2: /* Step 2:
* Look up flow ID in table and get corresponding socket */ * Look up flow ID in table and get corresponding socket */
sk = __inet_lookup(&init_net, &dccp_hashinfo, sk = __inet_lookup(dev_net(skb->dst->dev), &dccp_hashinfo,
iph->saddr, dh->dccph_sport, iph->saddr, dh->dccph_sport,
iph->daddr, dh->dccph_dport, inet_iif(skb)); iph->daddr, dh->dccph_dport, inet_iif(skb));
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册