Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Upgrade to 4.4.50-rt62
[kvmfornfv.git]
/
kernel
/
net
/
ipv6
/
ip6mr.c
diff --git
a/kernel/net/ipv6/ip6mr.c
b/kernel/net/ipv6/ip6mr.c
index
5f36266
..
d9843e5
100644
(file)
--- a/
kernel/net/ipv6/ip6mr.c
+++ b/
kernel/net/ipv6/ip6mr.c
@@
-118,7
+118,7
@@
static void mr6_netlink_event(struct mr6_table *mrt, struct mfc6_cache *mfc,
int cmd);
static int ip6mr_rtm_dumproute(struct sk_buff *skb,
struct netlink_callback *cb);
int cmd);
static int ip6mr_rtm_dumproute(struct sk_buff *skb,
struct netlink_callback *cb);
-static void mroute_clean_tables(struct mr6_table *mrt);
+static void mroute_clean_tables(struct mr6_table *mrt
, bool all
);
static void ipmr_expire_process(unsigned long arg);
#ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
static void ipmr_expire_process(unsigned long arg);
#ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
@@
-217,7
+217,6
@@
static const struct fib_rules_ops __net_initconst ip6mr_rules_ops_template = {
.match = ip6mr_rule_match,
.configure = ip6mr_rule_configure,
.compare = ip6mr_rule_compare,
.match = ip6mr_rule_match,
.configure = ip6mr_rule_configure,
.compare = ip6mr_rule_compare,
- .default_pref = fib_default_rule_pref,
.fill = ip6mr_rule_fill,
.nlgroup = RTNLGRP_IPV6_RULE,
.policy = ip6mr_rule_policy,
.fill = ip6mr_rule_fill,
.nlgroup = RTNLGRP_IPV6_RULE,
.policy = ip6mr_rule_policy,
@@
-335,7
+334,7
@@
static struct mr6_table *ip6mr_new_table(struct net *net, u32 id)
static void ip6mr_free_table(struct mr6_table *mrt)
{
del_timer_sync(&mrt->ipmr_expire_timer);
static void ip6mr_free_table(struct mr6_table *mrt)
{
del_timer_sync(&mrt->ipmr_expire_timer);
- mroute_clean_tables(mrt);
+ mroute_clean_tables(mrt
, true
);
kfree(mrt);
}
kfree(mrt);
}
@@
-766,10
+765,6
@@
static struct net_device *ip6mr_reg_vif(struct net *net, struct mr6_table *mrt)
return dev;
failure:
return dev;
failure:
- /* allow the register to be completed before unregistering. */
- rtnl_unlock();
- rtnl_lock();
-
unregister_netdevice(dev);
return NULL;
}
unregister_netdevice(dev);
return NULL;
}
@@
-1079,6
+1074,7
@@
static struct mfc6_cache *ip6mr_cache_alloc(void)
struct mfc6_cache *c = kmem_cache_zalloc(mrt_cachep, GFP_KERNEL);
if (!c)
return NULL;
struct mfc6_cache *c = kmem_cache_zalloc(mrt_cachep, GFP_KERNEL);
if (!c)
return NULL;
+ c->mfc_un.res.last_assert = jiffies - MFC_ASSERT_THRESH - 1;
c->mfc_un.res.minvif = MAXMIFS;
return c;
}
c->mfc_un.res.minvif = MAXMIFS;
return c;
}
@@
-1543,7
+1539,7
@@
static int ip6mr_mfc_add(struct net *net, struct mr6_table *mrt,
* Close the multicast socket, and clear the vif tables etc
*/
* Close the multicast socket, and clear the vif tables etc
*/
-static void mroute_clean_tables(struct mr6_table *mrt)
+static void mroute_clean_tables(struct mr6_table *mrt
, bool all
)
{
int i;
LIST_HEAD(list);
{
int i;
LIST_HEAD(list);
@@
-1553,8
+1549,9
@@
static void mroute_clean_tables(struct mr6_table *mrt)
* Shut down all active vif entries
*/
for (i = 0; i < mrt->maxvif; i++) {
* Shut down all active vif entries
*/
for (i = 0; i < mrt->maxvif; i++) {
- if (!(mrt->vif6_table[i].flags & VIFF_STATIC))
- mif6_delete(mrt, i, &list);
+ if (!all && (mrt->vif6_table[i].flags & VIFF_STATIC))
+ continue;
+ mif6_delete(mrt, i, &list);
}
unregister_netdevice_many(&list);
}
unregister_netdevice_many(&list);
@@
-1563,7
+1560,7
@@
static void mroute_clean_tables(struct mr6_table *mrt)
*/
for (i = 0; i < MFC6_LINES; i++) {
list_for_each_entry_safe(c, next, &mrt->mfc6_cache_array[i], list) {
*/
for (i = 0; i < MFC6_LINES; i++) {
list_for_each_entry_safe(c, next, &mrt->mfc6_cache_array[i], list) {
- if (
c->mfc_flags & MFC_STATIC
)
+ if (
!all && (c->mfc_flags & MFC_STATIC)
)
continue;
write_lock_bh(&mrt_lock);
list_del(&c->list);
continue;
write_lock_bh(&mrt_lock);
list_del(&c->list);
@@
-1626,7
+1623,7
@@
int ip6mr_sk_done(struct sock *sk)
net->ipv6.devconf_all);
write_unlock_bh(&mrt_lock);
net->ipv6.devconf_all);
write_unlock_bh(&mrt_lock);
- mroute_clean_tables(mrt);
+ mroute_clean_tables(mrt
, false
);
err = 0;
break;
}
err = 0;
break;
}
@@
-1986,13
+1983,13
@@
int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
}
#endif
}
#endif
-static inline int ip6mr_forward2_finish(struct sock *sk, struct sk_buff *skb)
+static inline int ip6mr_forward2_finish(struct
net *net, struct
sock *sk, struct sk_buff *skb)
{
{
- IP6_INC_STATS_BH(
dev_net(skb_dst(skb)->dev)
, ip6_dst_idev(skb_dst(skb)),
+ IP6_INC_STATS_BH(
net
, ip6_dst_idev(skb_dst(skb)),
IPSTATS_MIB_OUTFORWDATAGRAMS);
IPSTATS_MIB_OUTFORWDATAGRAMS);
- IP6_ADD_STATS_BH(
dev_net(skb_dst(skb)->dev)
, ip6_dst_idev(skb_dst(skb)),
+ IP6_ADD_STATS_BH(
net
, ip6_dst_idev(skb_dst(skb)),
IPSTATS_MIB_OUTOCTETS, skb->len);
IPSTATS_MIB_OUTOCTETS, skb->len);
- return dst_output
_sk(
sk, skb);
+ return dst_output
(net,
sk, skb);
}
/*
}
/*
@@
-2064,8
+2061,8
@@
static int ip6mr_forward2(struct net *net, struct mr6_table *mrt,
IP6CB(skb)->flags |= IP6SKB_FORWARDED;
IP6CB(skb)->flags |= IP6SKB_FORWARDED;
- return NF_HOOK(NFPROTO_IPV6, NF_INET_FORWARD,
NULL, skb,
- skb->dev, dev,
+ return NF_HOOK(NFPROTO_IPV6, NF_INET_FORWARD,
+
net, NULL, skb,
skb->dev, dev,
ip6mr_forward2_finish);
out_free:
ip6mr_forward2_finish);
out_free:
@@
-2279,8
+2276,8
@@
static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
return 1;
}
return 1;
}
-int ip6mr_get_route(struct net *net,
-
struct sk_buff *skb, struct rtmsg *rtm, int nowait
)
+int ip6mr_get_route(struct net *net,
struct sk_buff *skb, struct rtmsg *rtm,
+
int nowait, u32 portid
)
{
int err;
struct mr6_table *mrt;
{
int err;
struct mr6_table *mrt;
@@
-2325,6
+2322,7
@@
int ip6mr_get_route(struct net *net,
return -ENOMEM;
}
return -ENOMEM;
}
+ NETLINK_CB(skb2).portid = portid;
skb_reset_transport_header(skb2);
skb_put(skb2, sizeof(struct ipv6hdr));
skb_reset_transport_header(skb2);
skb_put(skb2, sizeof(struct ipv6hdr));