aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-15 03:34:17 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:54 -0400
commitf21c7bc5f6a0a5bd03988886ff46656bc3f255b7 (patch)
treefdbb479b329d10a23315c57573b3485214dfdd1f /net/ipv4/fib_semantics.c
parentd6062cbbd1f5e92c94e5eae9ef1a280ed48d56d5 (diff)
[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>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index ab753df20a39..5dfdad5cbcd4 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -33,7 +33,6 @@
33#include <linux/if_arp.h> 33#include <linux/if_arp.h>
34#include <linux/proc_fs.h> 34#include <linux/proc_fs.h>
35#include <linux/skbuff.h> 35#include <linux/skbuff.h>
36#include <linux/netlink.h>
37#include <linux/init.h> 36#include <linux/init.h>
38 37
39#include <net/arp.h> 38#include <net/arp.h>
@@ -44,6 +43,7 @@
44#include <net/sock.h> 43#include <net/sock.h>
45#include <net/ip_fib.h> 44#include <net/ip_fib.h>
46#include <net/ip_mp_alg.h> 45#include <net/ip_mp_alg.h>
46#include <net/netlink.h>
47 47
48#include "fib_lookup.h" 48#include "fib_lookup.h"
49 49
@@ -278,25 +278,25 @@ void rtmsg_fib(int event, u32 key, struct fib_alias *fa,
278{ 278{
279 struct sk_buff *skb; 279 struct sk_buff *skb;
280 u32 pid = req ? req->pid : n->nlmsg_pid; 280 u32 pid = req ? req->pid : n->nlmsg_pid;
281 int size = NLMSG_SPACE(sizeof(struct rtmsg)+256); 281 int payload = sizeof(struct rtmsg) + 256;
282 int err = -ENOBUFS;
282 283
283 skb = alloc_skb(size, GFP_KERNEL); 284 skb = nlmsg_new(nlmsg_total_size(payload), GFP_KERNEL);
284 if (!skb) 285 if (skb == NULL)
285 return; 286 goto errout;
286 287
287 if (fib_dump_info(skb, pid, n->nlmsg_seq, event, tb_id, 288 err = fib_dump_info(skb, pid, n->nlmsg_seq, event, tb_id,
288 fa->fa_type, fa->fa_scope, &key, z, 289 fa->fa_type, fa->fa_scope, &key, z, fa->fa_tos,
289 fa->fa_tos, 290 fa->fa_info, 0);
290 fa->fa_info, 0) < 0) { 291 if (err < 0) {
291 kfree_skb(skb); 292 kfree_skb(skb);
292 return; 293 goto errout;
293 } 294 }
294 NETLINK_CB(skb).dst_group = RTNLGRP_IPV4_ROUTE; 295
295 if (n->nlmsg_flags&NLM_F_ECHO) 296 err = rtnl_notify(skb, pid, RTNLGRP_IPV4_ROUTE, n, GFP_KERNEL);
296 atomic_inc(&skb->users); 297errout:
297 netlink_broadcast(rtnl, skb, pid, RTNLGRP_IPV4_ROUTE, GFP_KERNEL); 298 if (err < 0)
298 if (n->nlmsg_flags&NLM_F_ECHO) 299 rtnl_set_sk_err(RTNLGRP_IPV4_ROUTE, err);
299 netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT);
300} 300}
301 301
302/* Return the first fib alias matching TOS with 302/* Return the first fib alias matching TOS with