Commit 0ec6d3f4 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[NET] link: Convert notifications to use rtnl_notify()

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bd5785ba
...@@ -630,20 +630,22 @@ static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -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) void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
{ {
struct sk_buff *skb; struct sk_buff *skb;
int size = NLMSG_SPACE(sizeof(struct ifinfomsg) + int err = -ENOBUFS;
sizeof(struct rtnl_link_ifmap) +
sizeof(struct rtnl_link_stats) + 128);
skb = nlmsg_new(size, GFP_KERNEL); skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
if (!skb) if (skb == NULL)
return; 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); 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. */ /* Protected by RTNL sempahore. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment