diff mbox series

[iproute2] iplink: don't try to get ll addr len when creating an iface

Message ID 20190529144210.9501-1-nicolas.dichtel@6wind.com
State Accepted
Delegated to: stephen hemminger
Headers show
Series [iproute2] iplink: don't try to get ll addr len when creating an iface | expand

Commit Message

Nicolas Dichtel May 29, 2019, 2:42 p.m. UTC
It will obviously fail. This is a follow up of the commit
757837230a65 ("lib: suppress error msg when filling the cache").

Suggested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 ip/iplink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stephen Hemminger May 30, 2019, 6:05 p.m. UTC | #1
On Wed, 29 May 2019 16:42:10 +0200
Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:

> It will obviously fail. This is a follow up of the commit
> 757837230a65 ("lib: suppress error msg when filling the cache").
> 
> Suggested-by: David Ahern <dsahern@gmail.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Looks good, thanks for following up.
Applied.
diff mbox series

Patch

diff --git a/ip/iplink.c b/ip/iplink.c
index 7952cb2be364..d275efa9d087 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -945,7 +945,8 @@  int iplink_parse(int argc, char **argv, struct iplink_req *req, char **type)
 	else if (!strcmp(name, dev))
 		name = dev;
 
-	if (dev && addr_len) {
+	if (dev && addr_len &&
+	    !(req->n.nlmsg_flags & NLM_F_CREATE)) {
 		int halen = nl_get_ll_addr_len(dev);
 
 		if (halen >= 0 && halen != addr_len) {