From: Nicolas Dichtel Date: Wed, 29 May 2019 14:42:10 +0000 (+0200) Subject: iplink: don't try to get ll addr len when creating an iface X-Git-Tag: v5.2.0~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c442234858a6bf3ee954f5e482dac9486ece5f17;p=thirdparty%2Fiproute2.git iplink: don't try to get ll addr len when creating an iface 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 Signed-off-by: Nicolas Dichtel Signed-off-by: Stephen Hemminger --- diff --git a/ip/iplink.c b/ip/iplink.c index 7952cb2be..d275efa9d 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) {