aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-15 03:36:07 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:58 -0400
commit8c384bfa36b1dbeba8154da20d49167ce3e275c4 (patch)
tree799c78f4b32fc3651bb5e53bc0a8042bbf322828 /net/ipv6/addrconf.c
parent8d7a76c9b17866f426fcbb531c81af7a1f53e071 (diff)
[IPv6] prefix: Convert prefix 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/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 2a3be0f1c516..4af741ef8d6b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3506,20 +3506,23 @@ static void inet6_prefix_notify(int event, struct inet6_dev *idev,
3506 struct prefix_info *pinfo) 3506 struct prefix_info *pinfo)
3507{ 3507{
3508 struct sk_buff *skb; 3508 struct sk_buff *skb;
3509 int size = NLMSG_SPACE(sizeof(struct prefixmsg) + INET6_PREFIX_RTA_SPACE); 3509 int payload = sizeof(struct prefixmsg) + INET6_PREFIX_RTA_SPACE;
3510 int err = -ENOBUFS;
3510 3511
3511 skb = alloc_skb(size, GFP_ATOMIC); 3512 skb = nlmsg_new(nlmsg_total_size(payload), GFP_ATOMIC);
3512 if (!skb) { 3513 if (skb == NULL)
3513 netlink_set_err(rtnl, 0, RTNLGRP_IPV6_PREFIX, ENOBUFS); 3514 goto errout;
3514 return; 3515
3515 } 3516 err = inet6_fill_prefix(skb, idev, pinfo, 0, 0, event, 0);
3516 if (inet6_fill_prefix(skb, idev, pinfo, current->pid, 0, event, 0) < 0) { 3517 if (err < 0) {
3517 kfree_skb(skb); 3518 kfree_skb(skb);
3518 netlink_set_err(rtnl, 0, RTNLGRP_IPV6_PREFIX, EINVAL); 3519 goto errout;
3519 return;
3520 } 3520 }
3521 NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_PREFIX; 3521
3522 netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_PREFIX, GFP_ATOMIC); 3522 err = rtnl_notify(skb, 0, RTNLGRP_IPV6_PREFIX, NULL, GFP_ATOMIC);
3523errout:
3524 if (err < 0)
3525 rtnl_set_sk_err(RTNLGRP_IPV6_PREFIX, err);
3523} 3526}
3524 3527
3525static struct rtnetlink_link inet6_rtnetlink_table[RTM_NR_MSGTYPES] = { 3528static struct rtnetlink_link inet6_rtnetlink_table[RTM_NR_MSGTYPES] = {