From: Stephen Hemminger <stephen@networkplumber•org>
To: Maks Mishin <maks.mishinfz@gmail•com>
Cc: netdev@vger•kernel.org
Subject: Re: [PATCH] iproute_lwtunnel: Add check for result of get_u32 function
Date: Sun, 7 Jul 2024 14:22:44 -0700 [thread overview]
Message-ID: <20240707142244.32c86b93@hermes.local> (raw)
In-Reply-To: <20240707154928.20090-1-maks.mishinFZ@gmail.com>
On Sun, 7 Jul 2024 18:49:28 +0300
Maks Mishin <maks.mishinfz@gmail•com> wrote:
> Signed-off-by: Maks Mishin <maks.mishinFZ@gmail•com>
> ---
> ip/iproute_lwtunnel.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
> index b4df4348..2946fa4d 100644
> --- a/ip/iproute_lwtunnel.c
> +++ b/ip/iproute_lwtunnel.c
> @@ -1484,7 +1484,8 @@ static int parse_encap_seg6local(struct rtattr *rta, size_t len, int *argcp,
> NEXT_ARG();
> if (hmac_ok++)
> duparg2("hmac", *argv);
> - get_u32(&hmac, *argv, 0);
> + if (get_u32(&hmac, *argv, 0) || hmac == 0)
> + invarg("\"hmac\" value is invalid\n", *argv);
> } else {
> continue;
> }
Fixes: 8db158b9caac ("iproute: add support for SRv6 local segment processing")
The message is not that great. Becomes:
Error: argument "XXX" is wrong: "hmac" value is invalid.
But the rest of the tunnel parsing is equally as cryptic on error messages.
next prev parent reply other threads:[~2024-07-07 21:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-07 15:49 [PATCH] iproute_lwtunnel: Add check for result of get_u32 function Maks Mishin
2024-07-07 21:22 ` Stephen Hemminger [this message]
2024-07-08 22:19 ` 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=20240707142244.32c86b93@hermes.local \
--to=stephen@networkplumber$(echo .)org \
--cc=maks.mishinfz@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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