aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Pfister <ppfister@cisco.com>2016-06-29 14:20:00 +0100
committerPierre Pfister <ppfister@cisco.com>2016-06-29 14:20:00 +0100
commit41d2e7883d069b7c2fe856ca7dc374d200e3a478 (patch)
tree55b8e47302b663f08e6f5a9633b2a7b68155e30d
parent110b09821a7b1de438ca22d7407436dce658bfde (diff)
[Netlink] Namespace name formatting bugfix and reduced verbosity
Change-Id: Idf7d9cff0bf5b4e8c9eea8a38a61c75ee9d3da1c Signed-off-by: Pierre Pfister <ppfister@cisco.com>
-rw-r--r--netlink/librtnl/mapper.c2
-rw-r--r--netlink/librtnl/rtnl.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/netlink/librtnl/mapper.c b/netlink/librtnl/mapper.c
index 6d39e92..dd53684 100644
--- a/netlink/librtnl/mapper.c
+++ b/netlink/librtnl/mapper.c
@@ -63,7 +63,6 @@ int mapper_add_del_route(mapper_ns_t *ns, ns_route_t *route, int del)
if (route->rtm.rtm_dst_len >= 8 && route->dst[0] == 0xff)
return 0;
- clib_warning("Adding v6 route");
struct ip6_main_t *im = &ip6_main;
ip6_add_del_route_next_hop(im, //ip6_main
del?IP6_ROUTE_FLAG_DEL:IP6_ROUTE_FLAG_ADD, //flags (not del)
@@ -75,7 +74,6 @@ int mapper_add_del_route(mapper_ns_t *ns, ns_route_t *route, int del)
~0, //adj_index
ns->v6fib_index);
} else {
- clib_warning("Adding v4 route");
struct ip4_main_t *im = &ip4_main;
ip4_add_del_route_next_hop(im, //ip4_main
del?IP4_ROUTE_FLAG_DEL:IP4_ROUTE_FLAG_ADD, //flags (not del)
diff --git a/netlink/librtnl/rtnl.c b/netlink/librtnl/rtnl.c
index d66c2ee..04f0440 100644
--- a/netlink/librtnl/rtnl.c
+++ b/netlink/librtnl/rtnl.c
@@ -86,7 +86,7 @@ u8 *format_rtnl_nsname2path(u8 *s, va_list *args)
} else if (strpbrk(nsname, "/") != NULL) {
return format(s, "%s", nsname);
} else {
- return format((u8 *)0, "/var/run/netns/%s", nsname);
+ return format(s, "/var/run/netns/%s", nsname);
}
}
@@ -552,8 +552,10 @@ rtnl_stream_open(rtnl_stream_t *template)
rtnl_ns_t *ns;
int fd;
u8 *s = format((u8 *)0, "%U", format_rtnl_nsname2path, template->name);
+ vec_add1(s, 0);
if ((fd = open((char *)s, O_RDONLY)) < 0) {
+ clib_unix_warning("open stream %s: ", s);
vec_free(s);
return ~0;
}