Skip to content

Commit

Permalink
[IPIP]: Use proper net in hash-lookup functions.
Browse files Browse the repository at this point in the history
This is the part#2 of the previous patch - get the proper
net for these functions.

I make it in a separate patch, so that this change does not
get lost in a large previous patch.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Apr 16, 2008
1 parent b9fae5c commit cec3ffa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/ipip.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static int ipip_err(struct sk_buff *skb, u32 info)
err = -ENOENT;

read_lock(&ipip_lock);
t = ipip_tunnel_lookup(&init_net, iph->daddr, iph->saddr);
t = ipip_tunnel_lookup(dev_net(skb->dev), iph->daddr, iph->saddr);
if (t == NULL || t->parms.iph.daddr == 0)
goto out;

Expand Down Expand Up @@ -478,7 +478,7 @@ static int ipip_rcv(struct sk_buff *skb)
const struct iphdr *iph = ip_hdr(skb);

read_lock(&ipip_lock);
if ((tunnel = ipip_tunnel_lookup(&init_net,
if ((tunnel = ipip_tunnel_lookup(dev_net(skb->dev),
iph->saddr, iph->daddr)) != NULL) {
if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
read_unlock(&ipip_lock);
Expand Down

0 comments on commit cec3ffa

Please sign in to comment.