From: David Ahern <dsahern@gmail.com>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>, stephen@networkplumber.org
Cc: netdev@vger.kernel.org, Philippe Guibert <philippe.guibert@6wind.com>
Subject: Re: [PATCH iproute2] lib: suppress error msg when filling the cache
Date: Fri, 24 May 2019 10:08:28 -0600 [thread overview]
Message-ID: <bc4ad34f-96d4-68e2-a67e-afa9e391906e@gmail.com> (raw)
In-Reply-To: <20190524085910.16018-1-nicolas.dichtel@6wind.com>
On 5/24/19 2:59 AM, Nicolas Dichtel wrote:
> 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>
> ---
> lib/ll_map.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/ll_map.c b/lib/ll_map.c
> index 2d7b65dcb8f7..e0ed54bf77c9 100644
> --- a/lib/ll_map.c
> +++ b/lib/ll_map.c
> @@ -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 */
>
In general, ll_link_get suppressing the error message seems like the
right thing to do.
For the example above, seems like nl_get_ll_addr_len is the cause of the
error messages, and it should not be called for this use case (NEWLINK
with NLM_F_CREATE set)
next prev parent reply other threads:[~2019-05-24 16:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-24 8:59 [PATCH iproute2] lib: suppress error msg when filling the cache Nicolas Dichtel
2019-05-24 16:08 ` David Ahern [this message]
2019-05-28 19:25 ` Stephen Hemminger
2019-05-29 14:42 ` [PATCH iproute2] iplink: don't try to get ll addr len when creating an iface Nicolas Dichtel
2019-05-30 18:05 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bc4ad34f-96d4-68e2-a67e-afa9e391906e@gmail.com \
--to=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=philippe.guibert@6wind.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).