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]
Message-ID: <52F8D56A.2090704@cogentembedded.com>
Date:	Mon, 10 Feb 2014 17:34:34 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Michal Kubecek <mkubecek@...e.cz>,
	Stephen Hemminger <stephen@...workplumber.org>
CC:	netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 net-next-for-3.13 1/2] iplink: display slave
 information

Hello.

On 10-02-2014 12:11, Michal Kubecek wrote:

> Add print_slave_opt() callback and maxslattr value to struct
> link_util. These are analogous to print_opt() and maxattr but
> relate to slave info (IFLA_INFO_SLAVE_{KIND,DATA}).

> Display the slave specific info in output of "ip -d link show".

> Signed-off-by: Michal Kubecek <mkubecek@...e.cz>
[...]

> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index f794fa1..3cb7ee7 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
[...]
> @@ -221,6 +221,29 @@ static void print_linktype(FILE *fp, struct rtattr *tb)
>   		    lu->print_xstats)
>   			lu->print_xstats(lu, fp, linkinfo[IFLA_INFO_XSTATS]);
>   	}
> +
> +no_info:
> +	if (!linkinfo[IFLA_INFO_SLAVE_KIND])
> +		return;
> +	kind = RTA_DATA(linkinfo[IFLA_INFO_SLAVE_KIND]);
> +
> +	fprintf(fp, "%s", _SL_);
> +	fprintf(fp, "    %s_slave ", kind);
> +
> +	lu = get_link_kind(kind);
> +	if (!lu || !lu->print_slave_opt)
> +		return;
> +
> +	if (1) {

    Why is that?

> +		struct rtattr *attr[lu->maxslattr+1], **data = NULL;
> +
> +		if (linkinfo[IFLA_INFO_SLAVE_DATA]) {
> +			parse_rtattr_nested(attr, lu->maxslattr,
> +					    linkinfo[IFLA_INFO_SLAVE_DATA]);
> +			data = attr;
> +		}
> +		lu->print_slave_opt(lu, fp, data);
> +	}

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ