diff options
author | Thomas Graf <tgraf@suug.ch> | 2006-08-15 03:35:47 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:54:57 -0400 |
commit | 8d7a76c9b17866f426fcbb531c81af7a1f53e071 (patch) | |
tree | 4eb93041c3454f719324826072c6a42983701b1c /net/ipv6 | |
parent | 21713ebc4f119950e87d21c4637d5a750eea20e8 (diff) |
[IPv6] link: Convert link notifications to use rtnl_notify()
Fixes a wrong use of current->pid as netlink pid.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 81e9ef14676f..2a3be0f1c516 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -3438,20 +3438,23 @@ static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) | |||
3438 | void inet6_ifinfo_notify(int event, struct inet6_dev *idev) | 3438 | void inet6_ifinfo_notify(int event, struct inet6_dev *idev) |
3439 | { | 3439 | { |
3440 | struct sk_buff *skb; | 3440 | struct sk_buff *skb; |
3441 | int size = NLMSG_SPACE(sizeof(struct ifinfomsg) + INET6_IFINFO_RTA_SPACE); | 3441 | int payload = sizeof(struct ifinfomsg) + INET6_IFINFO_RTA_SPACE; |
3442 | int err = -ENOBUFS; | ||
3442 | 3443 | ||
3443 | skb = alloc_skb(size, GFP_ATOMIC); | 3444 | skb = nlmsg_new(nlmsg_total_size(payload), GFP_ATOMIC); |
3444 | if (!skb) { | 3445 | if (skb == NULL) |
3445 | netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFINFO, ENOBUFS); | 3446 | goto errout; |
3446 | return; | 3447 | |
3447 | } | 3448 | err = inet6_fill_ifinfo(skb, idev, 0, 0, event, 0); |
3448 | if (inet6_fill_ifinfo(skb, idev, current->pid, 0, event, 0) < 0) { | 3449 | if (err < 0) { |
3449 | kfree_skb(skb); | 3450 | kfree_skb(skb); |
3450 | netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFINFO, EINVAL); | 3451 | goto errout; |
3451 | return; | ||
3452 | } | 3452 | } |
3453 | NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_IFINFO; | 3453 | |
3454 | netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_IFINFO, GFP_ATOMIC); | 3454 | err = rtnl_notify(skb, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); |
3455 | errout: | ||
3456 | if (err < 0) | ||
3457 | rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err); | ||
3455 | } | 3458 | } |
3456 | 3459 | ||
3457 | /* Maximum length of prefix_cacheinfo attributes */ | 3460 | /* Maximum length of prefix_cacheinfo attributes */ |