From: Phil Sutter <phil@nwl.cc>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
netdev@vger.kernel.org, Petr Vorel <pvorel@suse.cz>
Subject: Re: [PATCH iproute2] ip maddr: fix filtering by device
Date: Thu, 19 Oct 2017 11:06:58 +0200 [thread overview]
Message-ID: <20171019090658.GA21378@orbyte.nwl.cc> (raw)
In-Reply-To: <20171019082108.40D7AA0EDF@unicorn.suse.cz>
On Thu, Oct 19, 2017 at 10:21:08AM +0200, Michal Kubecek wrote:
> Commit 530903dd9003 ("ip: fix igmp parsing when iface is long") uses
> variable len to keep trailing colon from interface name comparison. This
> variable is local to loop body but we set it in one pass and use it in
> following one(s) so that we are actually using (pseudo)random length for
> comparison. This became apparent since commit b48a1161f5f9 ("ipmaddr: Avoid
> accessing uninitialized data") always initializes len to zero so that the
> name comparison is always true. As a result, "ip maddr show dev eth0" shows
> IPv4 multicast addresses for all interfaces.
>
> Instead of keeping the length, let's simply replace the trailing colon with
> a null byte. The bonus is that we get correct interface name in ma.name.
>
> Fixes: 530903dd9003 ("ip: fix igmp parsing when iface is long")
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Acked-by: Phil Sutter <phil@nwl.cc>
next prev parent reply other threads:[~2017-10-19 9:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 8:21 [PATCH iproute2] ip maddr: fix filtering by device Michal Kubecek
2017-10-19 9:06 ` Phil Sutter [this message]
2017-10-19 9:14 ` Petr Vorel
2017-10-23 12:42 ` 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=20171019090658.GA21378@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=pvorel@suse.cz \
--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).