aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 62212c772a4b..28863570dd60 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -157,9 +157,12 @@ static struct mr_table *ipmr_get_table(struct net *net, u32 id)
157static int ipmr_fib_lookup(struct net *net, struct flowi4 *flp4, 157static int ipmr_fib_lookup(struct net *net, struct flowi4 *flp4,
158 struct mr_table **mrt) 158 struct mr_table **mrt)
159{ 159{
160 struct ipmr_result res;
161 struct fib_lookup_arg arg = { .result = &res, };
162 int err; 160 int err;
161 struct ipmr_result res;
162 struct fib_lookup_arg arg = {
163 .result = &res,
164 .flags = FIB_LOOKUP_NOREF,
165 };
163 166
164 err = fib_rules_lookup(net->ipv4.mr_rules_ops, 167 err = fib_rules_lookup(net->ipv4.mr_rules_ops,
165 flowi4_to_flowi(flp4), 0, &arg); 168 flowi4_to_flowi(flp4), 0, &arg);
@@ -425,6 +428,7 @@ struct net_device *ipmr_new_tunnel(struct net *net, struct vifctl *v)
425 goto failure; 428 goto failure;
426 429
427 ipv4_devconf_setall(in_dev); 430 ipv4_devconf_setall(in_dev);
431 neigh_parms_data_state_setall(in_dev->arp_parms);
428 IPV4_DEVCONF(in_dev->cnf, RP_FILTER) = 0; 432 IPV4_DEVCONF(in_dev->cnf, RP_FILTER) = 0;
429 433
430 if (dev_open(dev)) 434 if (dev_open(dev))
@@ -517,6 +521,7 @@ static struct net_device *ipmr_reg_vif(struct net *net, struct mr_table *mrt)
517 } 521 }
518 522
519 ipv4_devconf_setall(in_dev); 523 ipv4_devconf_setall(in_dev);
524 neigh_parms_data_state_setall(in_dev->arp_parms);
520 IPV4_DEVCONF(in_dev->cnf, RP_FILTER) = 0; 525 IPV4_DEVCONF(in_dev->cnf, RP_FILTER) = 0;
521 rcu_read_unlock(); 526 rcu_read_unlock();
522 527
@@ -2250,13 +2255,14 @@ int ipmr_get_route(struct net *net, struct sk_buff *skb,
2250} 2255}
2251 2256
2252static int ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, 2257static int ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
2253 u32 portid, u32 seq, struct mfc_cache *c, int cmd) 2258 u32 portid, u32 seq, struct mfc_cache *c, int cmd,
2259 int flags)
2254{ 2260{
2255 struct nlmsghdr *nlh; 2261 struct nlmsghdr *nlh;
2256 struct rtmsg *rtm; 2262 struct rtmsg *rtm;
2257 int err; 2263 int err;
2258 2264
2259 nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI); 2265 nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags);
2260 if (nlh == NULL) 2266 if (nlh == NULL)
2261 return -EMSGSIZE; 2267 return -EMSGSIZE;
2262 2268
@@ -2324,7 +2330,7 @@ static void mroute_netlink_event(struct mr_table *mrt, struct mfc_cache *mfc,
2324 if (skb == NULL) 2330 if (skb == NULL)
2325 goto errout; 2331 goto errout;
2326 2332
2327 err = ipmr_fill_mroute(mrt, skb, 0, 0, mfc, cmd); 2333 err = ipmr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0);
2328 if (err < 0) 2334 if (err < 0)
2329 goto errout; 2335 goto errout;
2330 2336
@@ -2363,7 +2369,8 @@ static int ipmr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)
2363 if (ipmr_fill_mroute(mrt, skb, 2369 if (ipmr_fill_mroute(mrt, skb,
2364 NETLINK_CB(cb->skb).portid, 2370 NETLINK_CB(cb->skb).portid,
2365 cb->nlh->nlmsg_seq, 2371 cb->nlh->nlmsg_seq,
2366 mfc, RTM_NEWROUTE) < 0) 2372 mfc, RTM_NEWROUTE,
2373 NLM_F_MULTI) < 0)
2367 goto done; 2374 goto done;
2368next_entry: 2375next_entry:
2369 e++; 2376 e++;
@@ -2377,7 +2384,8 @@ next_entry:
2377 if (ipmr_fill_mroute(mrt, skb, 2384 if (ipmr_fill_mroute(mrt, skb,
2378 NETLINK_CB(cb->skb).portid, 2385 NETLINK_CB(cb->skb).portid,
2379 cb->nlh->nlmsg_seq, 2386 cb->nlh->nlmsg_seq,
2380 mfc, RTM_NEWROUTE) < 0) { 2387 mfc, RTM_NEWROUTE,
2388 NLM_F_MULTI) < 0) {
2381 spin_unlock_bh(&mfc_unres_lock); 2389 spin_unlock_bh(&mfc_unres_lock);
2382 goto done; 2390 goto done;
2383 } 2391 }