lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Oct 2021 08:12:27 -0600
From:   David Ahern <dsahern@...il.com>
To:     Justin Iurman <justin.iurman@...ege.be>, netdev@...r.kernel.org
Cc:     davem@...emloft.net, dsahern@...nel.org, stephen@...workplumber.org
Subject: Re: [PATCH iproute2-next 1/2] Add support for IOAM encap modes

On 10/4/21 7:06 AM, Justin Iurman wrote:
> diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
> index 218d5086..3641f9ef 100644
> --- a/ip/iproute_lwtunnel.c
> +++ b/ip/iproute_lwtunnel.c
> @@ -210,16 +210,54 @@ static void print_encap_rpl(FILE *fp, struct rtattr *encap)
>  	print_rpl_srh(fp, srh);
>  }
>  
> +static const char *ioam6_mode_types[] = {

I think you want to declare this of size IOAM6_IPTUNNEL_MODE_MAX + 1

> +	[IOAM6_IPTUNNEL_MODE_INLINE]	= "inline",
> +	[IOAM6_IPTUNNEL_MODE_ENCAP]	= "encap",
> +	[IOAM6_IPTUNNEL_MODE_AUTO]	= "auto",
> +};
> +
> +static const char *format_ioam6mode_type(int mode)
> +{
> +	if (mode < IOAM6_IPTUNNEL_MODE_MIN ||
> +	    mode > IOAM6_IPTUNNEL_MODE_MAX ||
> +	    !ioam6_mode_types[mode])

otherwise this check is not sufficient.

> +		return "<unknown>";
> +
> +	return ioam6_mode_types[mode];
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ