From: Jiri Pirko <jiri@resnulli.us>
To: Thomas Haller <thaller@redhat.com>
Cc: netdev@vger.kernel.org, stephen@networkplumber.org
Subject: Re: [patch iproute2 2/2] iplink: print out addrgenmode attribute
Date: Tue, 6 Jan 2015 18:08:36 +0100 [thread overview]
Message-ID: <20150106170836.GA1921@nanopsycho.orion> (raw)
In-Reply-To: <1420563153.2527.14.camel@hal>
Tue, Jan 06, 2015 at 05:52:33PM CET, thaller@redhat.com wrote:
>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?
This prints only when show_details is on. So I believe it is ok to print
the default value of addrgenmode (same is done as for other things)
next prev parent reply other threads:[~2015-01-06 17:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 16:23 [patch iproute2 1/2] libnetlink: add parse_rtattr_one_nested helper Jiri Pirko
2015-01-06 16:23 ` [patch iproute2 2/2] iplink: print out addrgenmode attribute Jiri Pirko
2015-01-06 16:52 ` Thomas Haller
2015-01-06 17:08 ` Jiri Pirko [this message]
2015-01-07 23:10 ` Stephen Hemminger
2015-01-08 7:04 ` Jiri Pirko
2015-01-08 7:13 ` Vadim Kochan
2015-01-08 18:19 ` Stephen Hemminger
2015-01-07 23:15 ` [patch iproute2 1/2] libnetlink: add parse_rtattr_one_nested helper 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=20150106170836.GA1921@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=thaller@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).