diff mbox series

[net-next] ipv6: minor code reorg in inet6_fill_ifla6_attrs()

Message ID 20190930120216.22404-1-nicolas.dichtel@6wind.com
State Accepted
Delegated to: David Miller
Headers show
Series [net-next] ipv6: minor code reorg in inet6_fill_ifla6_attrs() | expand

Commit Message

Nicolas Dichtel Sept. 30, 2019, 12:02 p.m. UTC
Just put related code together to ease code reading: the memcpy() is
related to the nla_reserve().

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/addrconf.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

David Miller Oct. 1, 2019, 9:59 p.m. UTC | #1
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Mon, 30 Sep 2019 14:02:16 +0200

> Just put related code together to ease code reading: the memcpy() is
> related to the nla_reserve().
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.
diff mbox series

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 6a576ff92c39..413b00cf9c2b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -5552,14 +5552,13 @@  static int inet6_fill_ifla6_attrs(struct sk_buff *skb, struct inet6_dev *idev,
 	nla = nla_reserve(skb, IFLA_INET6_TOKEN, sizeof(struct in6_addr));
 	if (!nla)
 		goto nla_put_failure;
-
-	if (nla_put_u8(skb, IFLA_INET6_ADDR_GEN_MODE, idev->cnf.addr_gen_mode))
-		goto nla_put_failure;
-
 	read_lock_bh(&idev->lock);
 	memcpy(nla_data(nla), idev->token.s6_addr, nla_len(nla));
 	read_unlock_bh(&idev->lock);
 
+	if (nla_put_u8(skb, IFLA_INET6_ADDR_GEN_MODE, idev->cnf.addr_gen_mode))
+		goto nla_put_failure;
+
 	return 0;
 
 nla_put_failure: