Subject: Re: [patch iproute2 2/2] iplink: print out addrgenmode attribute

From: Thomas Haller <[email-masked]>
Date: Tue, 06 Jan 2015 17:52:33 +0100

On Tue, 2015-01-06 at 17:23 +0100, Jiri Pirko wrote:
> addrgenmode is currently write only by ip. So display this information
> if provided by kernel as well.

>  
> +static void print_af_spec(FILE *fp, struct rtattr *af_spec_attr)
> +{
> +	struct rtattr *inet6_attr;
> +	struct rtattr *tb[IFLA_INET6_MAX + 1];
> +
> +	inet6_attr = parse_rtattr_one_nested(AF_INET6, af_spec_attr);
> +	if (!inet6_attr)
> +		return;
> +
> +	parse_rtattr_nested(tb, IFLA_INET6_MAX, inet6_attr);
> +
> +	if (tb[IFLA_INET6_ADDR_GEN_MODE]) {
> +		switch (rta_getattr_u8(tb[IFLA_INET6_ADDR_GEN_MODE])) {
> +		case IN6_ADDR_GEN_MODE_EUI64:
> +			fprintf(fp, "addrgenmode eui64 ");

eui64 is the default and the behavior of older kernels.

I dunno, would it be better not to print the default case?

Thomas