aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
Diffstat (limited to 'net/core')
-rw-r--r--net/core/neighbour.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 2f4e06a13457..23ae5e5426db 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2409,36 +2409,35 @@ static struct file_operations neigh_stat_seq_fops = {
2409#endif /* CONFIG_PROC_FS */ 2409#endif /* CONFIG_PROC_FS */
2410 2410
2411#ifdef CONFIG_ARPD 2411#ifdef CONFIG_ARPD
2412void neigh_app_ns(struct neighbour *n) 2412static void __neigh_notify(struct neighbour *n, int type, int flags)
2413{ 2413{
2414 struct sk_buff *skb; 2414 struct sk_buff *skb;
2415 int err = -ENOBUFS;
2415 2416
2416 skb = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); 2417 skb = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC);
2417 if (skb == NULL) 2418 if (skb == NULL)
2418 return; 2419 goto errout;
2419 2420
2420 if (neigh_fill_info(skb, n, 0, 0, RTM_GETNEIGH, NLM_F_REQUEST) <= 0) 2421 err = neigh_fill_info(skb, n, 0, 0, type, flags);
2422 if (err < 0) {
2421 kfree_skb(skb); 2423 kfree_skb(skb);
2422 else { 2424 goto errout;
2423 NETLINK_CB(skb).dst_group = RTNLGRP_NEIGH;
2424 netlink_broadcast(rtnl, skb, 0, RTNLGRP_NEIGH, GFP_ATOMIC);
2425 } 2425 }
2426
2427 err = rtnl_notify(skb, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC);
2428errout:
2429 if (err < 0)
2430 rtnl_set_sk_err(RTNLGRP_NEIGH, err);
2426} 2431}
2427 2432
2428static void neigh_app_notify(struct neighbour *n) 2433void neigh_app_ns(struct neighbour *n)
2429{ 2434{
2430 struct sk_buff *skb; 2435 __neigh_notify(n, RTM_GETNEIGH, NLM_F_REQUEST);
2431 2436}
2432 skb = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC);
2433 if (skb == NULL)
2434 return;
2435 2437
2436 if (neigh_fill_info(skb, n, 0, 0, RTM_NEWNEIGH, 0) <= 0) 2438static void neigh_app_notify(struct neighbour *n)
2437 kfree_skb(skb); 2439{
2438 else { 2440 __neigh_notify(n, RTM_NEWNEIGH, 0);
2439 NETLINK_CB(skb).dst_group = RTNLGRP_NEIGH;
2440 netlink_broadcast(rtnl, skb, 0, RTNLGRP_NEIGH, GFP_ATOMIC);
2441 }
2442} 2441}
2443 2442
2444#endif /* CONFIG_ARPD */ 2443#endif /* CONFIG_ARPD */