[IPv4] route: Convert route notifications to 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
d6062cbbd1
commit
f21c7bc5f6
1 changed files with 16 additions and 16 deletions
|
@ -33,7 +33,6 @@
|
||||||
#include <linux/if_arp.h>
|
#include <linux/if_arp.h>
|
||||||
#include <linux/proc_fs.h>
|
#include <linux/proc_fs.h>
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
#include <linux/netlink.h>
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
|
||||||
#include <net/arp.h>
|
#include <net/arp.h>
|
||||||
|
@ -44,6 +43,7 @@
|
||||||
#include <net/sock.h>
|
#include <net/sock.h>
|
||||||
#include <net/ip_fib.h>
|
#include <net/ip_fib.h>
|
||||||
#include <net/ip_mp_alg.h>
|
#include <net/ip_mp_alg.h>
|
||||||
|
#include <net/netlink.h>
|
||||||
|
|
||||||
#include "fib_lookup.h"
|
#include "fib_lookup.h"
|
||||||
|
|
||||||
|
@ -278,25 +278,25 @@ void rtmsg_fib(int event, u32 key, struct fib_alias *fa,
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
u32 pid = req ? req->pid : n->nlmsg_pid;
|
u32 pid = req ? req->pid : n->nlmsg_pid;
|
||||||
int size = NLMSG_SPACE(sizeof(struct rtmsg)+256);
|
int payload = sizeof(struct rtmsg) + 256;
|
||||||
|
int err = -ENOBUFS;
|
||||||
|
|
||||||
skb = alloc_skb(size, GFP_KERNEL);
|
skb = nlmsg_new(nlmsg_total_size(payload), GFP_KERNEL);
|
||||||
if (!skb)
|
if (skb == NULL)
|
||||||
return;
|
goto errout;
|
||||||
|
|
||||||
if (fib_dump_info(skb, pid, n->nlmsg_seq, event, tb_id,
|
err = fib_dump_info(skb, pid, n->nlmsg_seq, event, tb_id,
|
||||||
fa->fa_type, fa->fa_scope, &key, z,
|
fa->fa_type, fa->fa_scope, &key, z, fa->fa_tos,
|
||||||
fa->fa_tos,
|
fa->fa_info, 0);
|
||||||
fa->fa_info, 0) < 0) {
|
if (err < 0) {
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
return;
|
goto errout;
|
||||||
}
|
}
|
||||||
NETLINK_CB(skb).dst_group = RTNLGRP_IPV4_ROUTE;
|
|
||||||
if (n->nlmsg_flags&NLM_F_ECHO)
|
err = rtnl_notify(skb, pid, RTNLGRP_IPV4_ROUTE, n, GFP_KERNEL);
|
||||||
atomic_inc(&skb->users);
|
errout:
|
||||||
netlink_broadcast(rtnl, skb, pid, RTNLGRP_IPV4_ROUTE, GFP_KERNEL);
|
if (err < 0)
|
||||||
if (n->nlmsg_flags&NLM_F_ECHO)
|
rtnl_set_sk_err(RTNLGRP_IPV4_ROUTE, err);
|
||||||
netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the first fib alias matching TOS with
|
/* Return the first fib alias matching TOS with
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue