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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 31 May 2018 11:46:15 -0400
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc:     shemminger@...tta.com, netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support

On Thu, 31 May 2018 16:28:48 +0200
Nicolas Dichtel <nicolas.dichtel@...nd.com> wrote:

> Parse and display those attributes.
> Example:
> ip l a type dummy
> ip netns add foo
> ip monitor link&
> ip l s dummy1 netns foo
> Deleted 6: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default
>     link/ether 66:af:3a:3f:a0:89 brd ff:ff:ff:ff:ff:ff new-nsid 0 new-ifindex 6
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
> ---
>  ip/ipaddress.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index 00da14c6f97c..c7c7e7df4e81 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -964,6 +964,17 @@ int print_linkinfo(const struct sockaddr_nl *who,
>  		}
>  	}
>  
> +	if (tb[IFLA_NEW_NETNSID]) {
> +		int id = rta_getattr_u32(tb[IFLA_NEW_NETNSID]);
> +
> +		print_int(PRINT_FP, NULL, " new-nsid %d", id);
> +	}
> +	if (tb[IFLA_NEW_IFINDEX]) {
> +		int id = rta_getattr_u32(tb[IFLA_NEW_IFINDEX]);
> +
> +		print_int(PRINT_FP, NULL, " new-ifindex %d", id);
> +	}
> +
>  	if (tb[IFLA_PROTO_DOWN]) {
>  		if (rta_getattr_u8(tb[IFLA_PROTO_DOWN]))
>  			print_bool(PRINT_ANY,

This makes sense. All of linkinfo that is present should be displayed.

Both netns and ifindex are really unsigned values. Use __u32 and print_uint.
Also why not convert numeric values to names?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ