mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
net/ipv6: Fix a test against 'ipv6_find_idev()' return value
[ Upstream commit 178fe94405 ]
'ipv6_find_idev()' returns NULL on error, not an error pointer.
Update the test accordingly and return -ENOBUFS, as already done in
'addrconf_add_dev()', if NULL is returned.
Fixes: ("ipv6: allow userspace to add IFA_F_OPTIMISTIC addresses")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5ac4cc331b
commit
fe3f820c18
@@ -4711,8 +4711,8 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
IFA_F_MCAUTOJOIN | IFA_F_OPTIMISTIC;
|
||||
|
||||
idev = ipv6_find_idev(dev);
|
||||
if (IS_ERR(idev))
|
||||
return PTR_ERR(idev);
|
||||
if (!idev)
|
||||
return -ENOBUFS;
|
||||
|
||||
if (!ipv6_allow_optimistic_dad(net, idev))
|
||||
cfg.ifa_flags &= ~IFA_F_OPTIMISTIC;
|
||||
|
||||
Reference in New Issue
Block a user