Skip to content

Commit

Permalink
[NETNS][DCCPV4]: Make per-net socket lookup.
Browse files Browse the repository at this point in the history
The inet_lookup family of functions requires a net to lookup
a socket in, so give a proper one to them.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Apr 14, 2008
1 parent f548739 commit b9901a8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
return;
}

sk = inet_lookup(&init_net, &dccp_hashinfo, iph->daddr, dh->dccph_dport,
iph->saddr, dh->dccph_sport, inet_iif(skb));
sk = inet_lookup(dev_net(skb->dev), &dccp_hashinfo,
iph->daddr, dh->dccph_dport,
iph->saddr, dh->dccph_sport, inet_iif(skb));
if (sk == NULL) {
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
return;
Expand Down Expand Up @@ -429,7 +430,7 @@ static struct sock *dccp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
if (req != NULL)
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->daddr, dh->dccph_dport,
inet_iif(skb));
Expand Down Expand Up @@ -810,7 +811,7 @@ static int dccp_v4_rcv(struct sk_buff *skb)

/* Step 2:
* 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->daddr, dh->dccph_dport, inet_iif(skb));
/*
Expand Down

0 comments on commit b9901a8

Please sign in to comment.