mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Minor overlapping changes in net/ipv4/ipmr.c, in 'net' we were fixing the "BH-ness" of the counter bumps whilst in 'net-next' the functions were modified to take an explicit 'net' parameter. Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
commit
73186df8d7
27 changed files with 192 additions and 92 deletions
|
|
@ -2080,7 +2080,6 @@ static int ip6_route_del(struct fib6_config *cfg)
|
|||
|
||||
static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
struct net *net = dev_net(skb->dev);
|
||||
struct netevent_redirect netevent;
|
||||
struct rt6_info *rt, *nrt = NULL;
|
||||
struct ndisc_options ndopts;
|
||||
|
|
@ -2141,7 +2140,7 @@ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_bu
|
|||
}
|
||||
|
||||
rt = (struct rt6_info *) dst;
|
||||
if (rt == net->ipv6.ip6_null_entry) {
|
||||
if (rt->rt6i_flags & RTF_REJECT) {
|
||||
net_dbg_ratelimited("rt6_redirect: source isn't a valid nexthop for redirect target\n");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1394,34 +1394,20 @@ static int ipip6_tunnel_init(struct net_device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __net_init ipip6_fb_tunnel_init(struct net_device *dev)
|
||||
static void __net_init ipip6_fb_tunnel_init(struct net_device *dev)
|
||||
{
|
||||
struct ip_tunnel *tunnel = netdev_priv(dev);
|
||||
struct iphdr *iph = &tunnel->parms.iph;
|
||||
struct net *net = dev_net(dev);
|
||||
struct sit_net *sitn = net_generic(net, sit_net_id);
|
||||
|
||||
tunnel->dev = dev;
|
||||
tunnel->net = dev_net(dev);
|
||||
|
||||
iph->version = 4;
|
||||
iph->protocol = IPPROTO_IPV6;
|
||||
iph->ihl = 5;
|
||||
iph->ttl = 64;
|
||||
|
||||
dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
|
||||
if (!dev->tstats)
|
||||
return -ENOMEM;
|
||||
|
||||
tunnel->dst_cache = alloc_percpu(struct ip_tunnel_dst);
|
||||
if (!tunnel->dst_cache) {
|
||||
free_percpu(dev->tstats);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
dev_hold(dev);
|
||||
rcu_assign_pointer(sitn->tunnels_wc[0], tunnel);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipip6_validate(struct nlattr *tb[], struct nlattr *data[])
|
||||
|
|
@ -1831,23 +1817,19 @@ static int __net_init sit_init_net(struct net *net)
|
|||
*/
|
||||
sitn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL;
|
||||
|
||||
err = ipip6_fb_tunnel_init(sitn->fb_tunnel_dev);
|
||||
if (err)
|
||||
goto err_dev_free;
|
||||
|
||||
ipip6_tunnel_clone_6rd(sitn->fb_tunnel_dev, sitn);
|
||||
err = register_netdev(sitn->fb_tunnel_dev);
|
||||
if (err)
|
||||
goto err_reg_dev;
|
||||
|
||||
ipip6_tunnel_clone_6rd(sitn->fb_tunnel_dev, sitn);
|
||||
ipip6_fb_tunnel_init(sitn->fb_tunnel_dev);
|
||||
|
||||
t = netdev_priv(sitn->fb_tunnel_dev);
|
||||
|
||||
strcpy(t->parms.name, sitn->fb_tunnel_dev->name);
|
||||
return 0;
|
||||
|
||||
err_reg_dev:
|
||||
dev_put(sitn->fb_tunnel_dev);
|
||||
err_dev_free:
|
||||
ipip6_dev_free(sitn->fb_tunnel_dev);
|
||||
err_alloc_dev:
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -144,6 +144,16 @@ static void tunnel6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
|||
break;
|
||||
}
|
||||
|
||||
static void tunnel46_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
||||
u8 type, u8 code, int offset, __be32 info)
|
||||
{
|
||||
struct xfrm6_tunnel *handler;
|
||||
|
||||
for_each_tunnel_rcu(tunnel46_handlers, handler)
|
||||
if (!handler->err_handler(skb, opt, type, code, offset, info))
|
||||
break;
|
||||
}
|
||||
|
||||
static const struct inet6_protocol tunnel6_protocol = {
|
||||
.handler = tunnel6_rcv,
|
||||
.err_handler = tunnel6_err,
|
||||
|
|
@ -152,7 +162,7 @@ static const struct inet6_protocol tunnel6_protocol = {
|
|||
|
||||
static const struct inet6_protocol tunnel46_protocol = {
|
||||
.handler = tunnel46_rcv,
|
||||
.err_handler = tunnel6_err,
|
||||
.err_handler = tunnel46_err,
|
||||
.flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue