Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214801
b: refs/heads/master
c: fada563
h: refs/heads/master
i:
  214799: 25d3c31
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 29, 2010
1 parent a4b052b commit 1aff9a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d81f41c58c69ddde497e9e640ba5805aa26e78c
refs/heads/master: fada5636fe41fd1423fe4e6af7b9f609378acde6
13 changes: 10 additions & 3 deletions trunk/net/ipv4/ipip.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ static int ipip_tunnel_init(struct net_device *dev)
return 0;
}

static void __net_init ipip_fb_tunnel_init(struct net_device *dev)
static int __net_init ipip_fb_tunnel_init(struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
struct iphdr *iph = &tunnel->parms.iph;
Expand All @@ -802,8 +802,13 @@ static void __net_init ipip_fb_tunnel_init(struct net_device *dev)
iph->protocol = IPPROTO_IPIP;
iph->ihl = 5;

dev->tstats = alloc_percpu(struct pcpu_tstats);
if (!dev->tstats)
return -ENOMEM;

dev_hold(dev);
rcu_assign_pointer(ipn->tunnels_wc[0], tunnel);
return 0;
}

static struct xfrm_tunnel ipip_handler __read_mostly = {
Expand Down Expand Up @@ -852,15 +857,17 @@ static int __net_init ipip_init_net(struct net *net)
}
dev_net_set(ipn->fb_tunnel_dev, net);

ipip_fb_tunnel_init(ipn->fb_tunnel_dev);
err = ipip_fb_tunnel_init(ipn->fb_tunnel_dev);
if (err)
goto err_reg_dev;

if ((err = register_netdev(ipn->fb_tunnel_dev)))
goto err_reg_dev;

return 0;

err_reg_dev:
free_netdev(ipn->fb_tunnel_dev);
ipip_dev_free(ipn->fb_tunnel_dev);
err_alloc_dev:
/* nothing */
return err;
Expand Down

0 comments on commit 1aff9a9

Please sign in to comment.