diff options
author | Thomas Graf <tgraf@suug.ch> | 2013-04-02 09:39:30 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2013-04-02 09:39:30 (GMT) |
commit | ff567100d6190c9014514f90de522281007c90db (patch) | |
tree | 668ef3bf3a7b290fd63ec959c872e25a0593fa95 /lib/route | |
parent | f9241d57fe1fd13aa9ae09d86fe8605451213ef2 (diff) | |
download | libnl-ff567100d6190c9014514f90de522281007c90db.zip libnl-ff567100d6190c9014514f90de522281007c90db.tar.gz libnl-ff567100d6190c9014514f90de522281007c90db.tar.bz2 |
nl: Print file:line:func in debugging messages and provide --disable-debug to disable debugging
Compiling libnl with --disable-debug will result in the ignorance
of the 'NLDBG' environment variable.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'lib/route')
-rw-r--r-- | lib/route/neigh.c | 2 | ||||
-rw-r--r-- | lib/route/route_obj.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/route/neigh.c b/lib/route/neigh.c index 288bb85..ad26b4d 100644 --- a/lib/route/neigh.c +++ b/lib/route/neigh.c @@ -211,7 +211,9 @@ static void neigh_keygen(struct nl_object *obj, uint32_t *hashkey, uint32_t n_ifindex; char n_addr[0]; } __attribute__((packed)) *nkey; +#ifdef NL_DEBUG char buf[INET6_ADDRSTRLEN+5]; +#endif if (neigh->n_family == AF_BRIDGE) { if (neigh->n_lladdr) diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c index 795047f..f2de523 100644 --- a/lib/route/route_obj.c +++ b/lib/route/route_obj.c @@ -307,7 +307,9 @@ static void route_keygen(struct nl_object *obj, uint32_t *hashkey, uint32_t rt_prio; char rt_addr[0]; } __attribute__((packed)) *rkey; +#ifdef NL_DEBUG char buf[INET6_ADDRSTRLEN+5]; +#endif if (route->rt_dst) addr = route->rt_dst; @@ -449,8 +451,10 @@ static int route_update(struct nl_object *old_obj, struct nl_object *new_obj) struct rtnl_route *new_route = (struct rtnl_route *) new_obj; struct rtnl_route *old_route = (struct rtnl_route *) old_obj; struct rtnl_nexthop *new_nh; - char buf[INET6_ADDRSTRLEN+5]; int action = new_obj->ce_msgtype; +#ifdef NL_DEBUG + char buf[INET6_ADDRSTRLEN+5]; +#endif /* * ipv6 ECMP route notifications from the kernel come as |