aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-15 03:37:09 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:55:01 -0400
commit0ec6d3f467faeec5dd3b617959eb90e9d520113d (patch)
tree9258098a14c5a2f50e730e4422d17eabbeadfcbb /net/core
parentbd5785ba3ac1c89aa4c351ceb2acd96686424d8c (diff)
[NET] link: Convert 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/core')
-rw-r--r--net/core/rtnetlink.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 2b1af17e6389..f5300b5dd0fd 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -630,20 +630,22 @@ static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
630void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) 630void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
631{ 631{
632 struct sk_buff *skb; 632 struct sk_buff *skb;
633 int size = NLMSG_SPACE(sizeof(struct ifinfomsg) + 633 int err = -ENOBUFS;
634 sizeof(struct rtnl_link_ifmap) +
635 sizeof(struct rtnl_link_stats) + 128);
636 634
637 skb = nlmsg_new(size, GFP_KERNEL); 635 skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
638 if (!skb) 636 if (skb == NULL)
639 return; 637 goto errout;
640 638
641 if (rtnl_fill_ifinfo(skb, dev, NULL, 0, type, 0, 0, change, 0) < 0) { 639 err = rtnl_fill_ifinfo(skb, dev, NULL, 0, type, 0, 0, change, 0);
640 if (err < 0) {
642 kfree_skb(skb); 641 kfree_skb(skb);
643 return; 642 goto errout;
644 } 643 }
645 NETLINK_CB(skb).dst_group = RTNLGRP_LINK; 644
646 netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK, GFP_KERNEL); 645 err = rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_KERNEL);
646errout:
647 if (err < 0)
648 rtnl_set_sk_err(RTNLGRP_LINK, err);
647} 649}
648 650
649/* Protected by RTNL sempahore. */ 651/* Protected by RTNL sempahore. */