Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d7a76c9 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller
Browse files

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



Fixes a wrong use of current->pid as netlink pid.

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 21713ebc
Loading
Loading
Loading
Loading
+14 −11
Original line number Original line Diff line number Diff line
@@ -3438,20 +3438,23 @@ static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
void inet6_ifinfo_notify(int event, struct inet6_dev *idev)
void inet6_ifinfo_notify(int event, struct inet6_dev *idev)
{
{
	struct sk_buff *skb;
	struct sk_buff *skb;
	int size = NLMSG_SPACE(sizeof(struct ifinfomsg) + INET6_IFINFO_RTA_SPACE);
	int payload = sizeof(struct ifinfomsg) + INET6_IFINFO_RTA_SPACE;
	int err = -ENOBUFS;
	
	
	skb = alloc_skb(size, GFP_ATOMIC);
	skb = nlmsg_new(nlmsg_total_size(payload), GFP_ATOMIC);
	if (!skb) {
	if (skb == NULL)
		netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFINFO, ENOBUFS);
		goto errout;
		return;

	}
	err = inet6_fill_ifinfo(skb, idev, 0, 0, event, 0);
	if (inet6_fill_ifinfo(skb, idev, current->pid, 0, event, 0) < 0) {
	if (err < 0) {
		kfree_skb(skb);
		kfree_skb(skb);
		netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFINFO, EINVAL);
		goto errout;
		return;
	}
	}
	NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_IFINFO;

	netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_IFINFO, GFP_ATOMIC);
	err = rtnl_notify(skb, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC);
errout:
	if (err < 0)
		rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err);
}
}


/* Maximum length of prefix_cacheinfo attributes */
/* Maximum length of prefix_cacheinfo attributes */