forked from luck/tmp_suning_uos_patched
[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>
This commit is contained in:
parent
c17084d21c
commit
b867331180
@ -2409,36 +2409,35 @@ static struct file_operations neigh_stat_seq_fops = {
|
|||||||
#endif /* CONFIG_PROC_FS */
|
#endif /* CONFIG_PROC_FS */
|
||||||
|
|
||||||
#ifdef CONFIG_ARPD
|
#ifdef CONFIG_ARPD
|
||||||
void neigh_app_ns(struct neighbour *n)
|
static void __neigh_notify(struct neighbour *n, int type, int flags)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
int err = -ENOBUFS;
|
||||||
|
|
||||||
skb = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC);
|
skb = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC);
|
||||||
if (skb == NULL)
|
if (skb == NULL)
|
||||||
return;
|
goto errout;
|
||||||
|
|
||||||
if (neigh_fill_info(skb, n, 0, 0, RTM_GETNEIGH, NLM_F_REQUEST) <= 0)
|
err = neigh_fill_info(skb, n, 0, 0, type, flags);
|
||||||
|
if (err < 0) {
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
else {
|
goto errout;
|
||||||
NETLINK_CB(skb).dst_group = RTNLGRP_NEIGH;
|
|
||||||
netlink_broadcast(rtnl, skb, 0, RTNLGRP_NEIGH, GFP_ATOMIC);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = rtnl_notify(skb, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC);
|
||||||
|
errout:
|
||||||
|
if (err < 0)
|
||||||
|
rtnl_set_sk_err(RTNLGRP_NEIGH, err);
|
||||||
|
}
|
||||||
|
|
||||||
|
void neigh_app_ns(struct neighbour *n)
|
||||||
|
{
|
||||||
|
__neigh_notify(n, RTM_GETNEIGH, NLM_F_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void neigh_app_notify(struct neighbour *n)
|
static void neigh_app_notify(struct neighbour *n)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
__neigh_notify(n, RTM_NEWNEIGH, 0);
|
||||||
|
|
||||||
skb = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC);
|
|
||||||
if (skb == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (neigh_fill_info(skb, n, 0, 0, RTM_NEWNEIGH, 0) <= 0)
|
|
||||||
kfree_skb(skb);
|
|
||||||
else {
|
|
||||||
NETLINK_CB(skb).dst_group = RTNLGRP_NEIGH;
|
|
||||||
netlink_broadcast(rtnl, skb, 0, RTNLGRP_NEIGH, GFP_ATOMIC);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_ARPD */
|
#endif /* CONFIG_ARPD */
|
||||||
|
Loading…
Reference in New Issue
Block a user