From: Guillaume Nault <gnault@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [PATCH iproute2-next 04/11] m_vlan: fix formatting of push ethernet src mac
Date: Sat, 8 Jan 2022 22:29:51 +0100 [thread overview]
Message-ID: <20220108212951.GA22261@pc-4.home> (raw)
In-Reply-To: <20220108204650.36185-5-sthemmin@microsoft.com>
On Sat, Jan 08, 2022 at 12:46:43PM -0800, Stephen Hemminger wrote:
> This was reported as a clang warning:
> CC m_vlan.o
> m_vlan.c:282:32: warning: converting the enum constant to a boolean [-Wint-in-bool-context]
> if (tb[TCA_VLAN_PUSH_ETH_SRC &&
> ^
>
> But it is really a bug in the code for displaying the pushed
> source mac.
>
> Fixes: d61167dd88b4 ("m_vlan: add pop_eth and push_eth actions")
> Cc: gnault@redhat.com
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> tc/m_vlan.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tc/m_vlan.c b/tc/m_vlan.c
> index 221083dfc0da..1b2b1d51ed2d 100644
> --- a/tc/m_vlan.c
> +++ b/tc/m_vlan.c
> @@ -279,8 +279,8 @@ static int print_vlan(struct action_util *au, FILE *f, struct rtattr *arg)
> ETH_ALEN, 0, b1, sizeof(b1));
> print_string(PRINT_ANY, "dst_mac", " dst_mac %s", b1);
> }
> - if (tb[TCA_VLAN_PUSH_ETH_SRC &&
> - RTA_PAYLOAD(tb[TCA_VLAN_PUSH_ETH_SRC]) == ETH_ALEN]) {
> + if (tb[TCA_VLAN_PUSH_ETH_SRC] &&
> + RTA_PAYLOAD(tb[TCA_VLAN_PUSH_ETH_SRC]) == ETH_ALEN) {
> ll_addr_n2a(RTA_DATA(tb[TCA_VLAN_PUSH_ETH_SRC]),
> ETH_ALEN, 0, b1, sizeof(b1));
> print_string(PRINT_ANY, "src_mac", " src_mac %s", b1);
This is already fixed in iproute2 with commit 0e949725908b ("tc/m_vlan:
fix print_vlan() conditional on TCA_VLAN_ACT_PUSH_ETH").
next prev parent reply other threads:[~2022-01-08 21:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-08 20:46 [PATCH iproute2-next 00/11] Clang warning fixes Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 01/11] tc: add format attribute to tc_print_rate Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 02/11] utils: add format attribute Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 03/11] netem: fix clang warnings Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 04/11] m_vlan: fix formatting of push ethernet src mac Stephen Hemminger
2022-01-08 21:29 ` Guillaume Nault [this message]
2022-01-08 20:46 ` [PATCH iproute2-next 05/11] flower: fix clang warnings Stephen Hemminger
2022-01-11 16:00 ` David Ahern
2022-01-08 20:46 ` [PATCH iproute2-next 06/11] nexthop: fix clang warning about timer check Stephen Hemminger
2022-01-11 13:31 ` Ido Schimmel
2022-01-11 16:01 ` David Ahern
2022-01-08 20:46 ` [PATCH iproute2-next 07/11] tc_util: fix clang warning in print_masked_type Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 08/11] ipl2tp: fix clang warning Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 09/11] can: " Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 10/11] tipc: fix clang warning about empty format string Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 11/11] tunnel: fix clang warning Stephen Hemminger
2022-01-10 17:20 ` [PATCH iproute2-next 00/11] Clang warning fixes 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=20220108212951.GA22261@pc-4.home \
--to=gnault@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=sthemmin@microsoft.com \
/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).