aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 4f991a2234d0..81e9ef14676f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -73,6 +73,7 @@
73#include <net/addrconf.h> 73#include <net/addrconf.h>
74#include <net/tcp.h> 74#include <net/tcp.h>
75#include <net/ip.h> 75#include <net/ip.h>
76#include <net/netlink.h>
76#include <linux/if_tunnel.h> 77#include <linux/if_tunnel.h>
77#include <linux/rtnetlink.h> 78#include <linux/rtnetlink.h>
78 79
@@ -3280,20 +3281,23 @@ out_free:
3280static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa) 3281static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa)
3281{ 3282{
3282 struct sk_buff *skb; 3283 struct sk_buff *skb;
3283 int size = NLMSG_SPACE(sizeof(struct ifaddrmsg) + INET6_IFADDR_RTA_SPACE); 3284 int payload = sizeof(struct ifaddrmsg) + INET6_IFADDR_RTA_SPACE;
3285 int err = -ENOBUFS;
3284 3286
3285 skb = alloc_skb(size, GFP_ATOMIC); 3287 skb = nlmsg_new(nlmsg_total_size(payload), GFP_ATOMIC);
3286 if (!skb) { 3288 if (skb == NULL)
3287 netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFADDR, ENOBUFS); 3289 goto errout;
3288 return; 3290
3289 } 3291 err = inet6_fill_ifaddr(skb, ifa, 0, 0, event, 0);
3290 if (inet6_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) { 3292 if (err < 0) {
3291 kfree_skb(skb); 3293 kfree_skb(skb);
3292 netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFADDR, EINVAL); 3294 goto errout;
3293 return;
3294 } 3295 }
3295 NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_IFADDR; 3296
3296 netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_IFADDR, GFP_ATOMIC); 3297 err = rtnl_notify(skb, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC);
3298errout:
3299 if (err < 0)
3300 rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err);
3297} 3301}
3298 3302
3299static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, 3303static void inline ipv6_store_devconf(struct ipv6_devconf *cnf,