]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
lib: suppress error msg when filling the cache
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Fri, 24 May 2019 08:59:10 +0000 (10:59 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 28 May 2019 19:23:52 +0000 (12:23 -0700)
Before the patch:
$ ip netns add foo
$ ip link add name veth1 address 2a:a5:5c:b9:52:89 type veth peer name veth2 address 2a:a5:5c:b9:53:90 netns foo
RTNETLINK answers: No such device
RTNETLINK answers: No such device

But the command was successful. This may break script. Let's remove those
error messages.

Fixes: 55870dfe7f8b ("Improve batch and dump times by caching link lookups")
Reported-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/ll_map.c

index 2d7b65dcb8f7e3a21b726199eee4cc3719669524..e0ed54bf77c988d1c552bcf80c613be4b5030848 100644 (file)
@@ -177,7 +177,7 @@ static int ll_link_get(const char *name, int index)
                addattr_l(&req.n, sizeof(req), IFLA_IFNAME, name,
                          strlen(name) + 1);
 
-       if (rtnl_talk(&rth, &req.n, &answer) < 0)
+       if (rtnl_talk_suppress_rtnl_errmsg(&rth, &req.n, &answer) < 0)
                goto out;
 
        /* add entry to cache */