diff options
author | Thomas Graf <tgraf@suug.ch> | 2006-08-15 03:33:14 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:54:51 -0400 |
commit | b8673311804ca29680dd584bd08352001fcbe2f8 (patch) | |
tree | c9061b88debe78fae16e60fcb43f1e931abfa448 /net/core | |
parent | c17084d21c18497b506bd28b82d964bc9e6c424b (diff) |
[NEIGH]: Convert neighbour notifications ot use rtnl_notify()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/neighbour.c | 35 |
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 |
2412 | void neigh_app_ns(struct neighbour *n) | 2412 | static 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); | ||
2428 | errout: | ||
2429 | if (err < 0) | ||
2430 | rtnl_set_sk_err(RTNLGRP_NEIGH, err); | ||
2426 | } | 2431 | } |
2427 | 2432 | ||
2428 | static void neigh_app_notify(struct neighbour *n) | 2433 | void 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) | 2438 | static 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 */ |