From: Stephen Hemminger <stephen@networkplumber.org>
To: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Cc: netdev@vger.kernel.org
Subject: Re: [net-next,iproute2] netconf: add support for ignore route attribute
Date: Sun, 13 Mar 2016 23:15:38 -0700 [thread overview]
Message-ID: <20160313231538.48e341dd@xeon-e3> (raw)
In-Reply-To: <1457931336-30205-1-git-send-email-zhangshengju@cmss.chinamobile.com>
On Mon, 14 Mar 2016 04:55:36 +0000
Zhang Shengju <zhangshengju@cmss.chinamobile.com> wrote:
> Add support for ignore_routes_with_linkdown attribute.
>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> ---
> ip/ipnetconf.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c
> index eca6eee..6fec818 100644
> --- a/ip/ipnetconf.c
> +++ b/ip/ipnetconf.c
> @@ -119,6 +119,10 @@ int print_netconf(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
> fprintf(fp, "proxy_neigh %s ",
> *(int *)RTA_DATA(tb[NETCONFA_PROXY_NEIGH])?"on":"off");
>
> + if (tb[NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN])
> + fprintf(fp, "ignore_routes_with_linkdown %s ",
> + *(int *)RTA_DATA(tb[NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN])?"on":"off");
This is a good idea.
But the option name is too long, and the code does not follow current best practices.
1. Lines are too long
2. There needs to be whitespace around ? :
3. There are helper routines (rte_getattr_XXX) which should be used rather than
cast RTE_DATA directly.
Also, help and man page??
next prev parent reply other threads:[~2016-03-14 6:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 4:55 [net-next,iproute2] netconf: add support for ignore route attribute Zhang Shengju
2016-03-14 6:15 ` Stephen Hemminger [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-03-14 8:31 张胜举
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=20160313231538.48e341dd@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=netdev@vger.kernel.org \
--cc=zhangshengju@cmss.chinamobile.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).