diff options
author | Thomas Graf <tgraf@suug.ch> | 2006-08-15 00:37:09 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 14:55:01 -0700 |
commit | 0ec6d3f467faeec5dd3b617959eb90e9d520113d (patch) | |
tree | 9258098a14c5a2f50e730e4422d17eabbeadfcbb /net/core | |
parent | bd5785ba3ac1c89aa4c351ceb2acd96686424d8c (diff) | |
download | linux-stable-0ec6d3f467faeec5dd3b617959eb90e9d520113d.tar.gz linux-stable-0ec6d3f467faeec5dd3b617959eb90e9d520113d.tar.bz2 linux-stable-0ec6d3f467faeec5dd3b617959eb90e9d520113d.zip |
[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.c | 22 |
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) void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) { struct sk_buff *skb; - int size = NLMSG_SPACE(sizeof(struct ifinfomsg) + - sizeof(struct rtnl_link_ifmap) + - sizeof(struct rtnl_link_stats) + 128); + int err = -ENOBUFS; - skb = nlmsg_new(size, GFP_KERNEL); - if (!skb) - return; + skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); + if (skb == NULL) + goto errout; - if (rtnl_fill_ifinfo(skb, dev, NULL, 0, type, 0, 0, change, 0) < 0) { + err = rtnl_fill_ifinfo(skb, dev, NULL, 0, type, 0, 0, change, 0); + if (err < 0) { kfree_skb(skb); - return; + goto errout; } - NETLINK_CB(skb).dst_group = RTNLGRP_LINK; - netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK, GFP_KERNEL); + + err = rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_KERNEL); +errout: + if (err < 0) + rtnl_set_sk_err(RTNLGRP_LINK, err); } /* Protected by RTNL sempahore. */ |