RE: [net-next,iproute2] netconf: add support for ignore route attribute

From: 张胜举 <hidden>
Date: 2016-03-14 08:31:29

On Mon, 14 Mar 2016 04:55:36 +0000
Zhang Shengju [off-list ref] wrote:
quoted
Add support for ignore_routes_with_linkdown attribute.

Signed-off-by: Zhang Shengju <redacted>
---
 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,
quoted
 		fprintf(fp, "proxy_neigh %s ",
 			*(int
*)RTA_DATA(tb[NETCONFA_PROXY_NEIGH])?"on":"off");
quoted
+	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.
I agree with you that the name is too long, but I can't figure out a shorter
name. 
Any good suggestion? What about "ignore_routes" ? 
  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??
Yes, man page need to be enhanced.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help