diff options
Diffstat (limited to 'babeld')
| -rw-r--r-- | babeld/babel_filter.c | 32 | ||||
| -rw-r--r-- | babeld/babel_interface.c | 4 | ||||
| -rw-r--r-- | babeld/babeld.c | 14 |
3 files changed, 15 insertions, 35 deletions
diff --git a/babeld/babel_filter.c b/babeld/babel_filter.c index 28ba8e16a2..731ad1ba8b 100644 --- a/babeld/babel_filter.c +++ b/babeld/babel_filter.c @@ -59,24 +59,16 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen, if (access_list_apply (babel_ifp->list[distribute], &p) == FILTER_DENY) { debugf(BABEL_DEBUG_FILTER, - "%s/%d filtered by distribute %s", - p.family == AF_INET ? - inet_ntoa(p.u.prefix4) : - inet6_ntoa (p.u.prefix6), - p.prefixlen, - output ? "out" : "in"); + "%pFX filtered by distribute %s", + &p, output ? "out" : "in"); return INFINITY; } } if (babel_ifp != NULL && babel_ifp->prefix[distribute]) { if (prefix_list_apply (babel_ifp->prefix[distribute], &p) == PREFIX_DENY) { - debugf(BABEL_DEBUG_FILTER, "%s/%d filtered by distribute %s", - p.family == AF_INET ? - inet_ntoa(p.u.prefix4) : - inet6_ntoa (p.u.prefix6), - p.prefixlen, - output ? "out" : "in"); + debugf(BABEL_DEBUG_FILTER, "%pFX filtered by distribute %s", + &p, output ? "out" : "in"); return INFINITY; } } @@ -91,12 +83,8 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen, if (alist) { if (access_list_apply (alist, &p) == FILTER_DENY) { - debugf(BABEL_DEBUG_FILTER,"%s/%d filtered by distribute %s", - p.family == AF_INET ? - inet_ntoa(p.u.prefix4) : - inet6_ntoa (p.u.prefix6), - p.prefixlen, - output ? "out" : "in"); + debugf(BABEL_DEBUG_FILTER,"%pFX filtered by distribute %s", + &p, output ? "out" : "in"); return INFINITY; } } @@ -105,12 +93,8 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen, plist = prefix_list_lookup (p.family, dist->prefix[distribute]); if (plist) { if (prefix_list_apply (plist, &p) == PREFIX_DENY) { - debugf(BABEL_DEBUG_FILTER,"%s/%d filtered by distribute %s", - p.family == AF_INET ? - inet_ntoa(p.u.prefix4) : - inet6_ntoa (p.u.prefix6), - p.prefixlen, - output ? "out" : "in"); + debugf(BABEL_DEBUG_FILTER,"%pFX filtered by distribute %s", + &p, output ? "out" : "in"); return INFINITY; } } diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index 1702d9277c..ae8b161b01 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -1106,6 +1106,7 @@ DEFUN (show_babel_route_addr, { struct in_addr addr; char buf[INET_ADDRSTRLEN + 8]; + char buf1[INET_ADDRSTRLEN + 8]; struct route_stream *routes = NULL; struct xroute_stream *xroutes = NULL; struct prefix prefix; @@ -1118,7 +1119,8 @@ DEFUN (show_babel_route_addr, } /* Quagga has no convenient prefix constructors. */ - snprintf(buf, sizeof(buf), "%s/%d", inet_ntoa(addr), 32); + snprintf(buf, sizeof(buf), "%s/%d", + inet_ntop(AF_INET, &addr, buf1, sizeof(buf1)), 32); ret = str2prefix(buf, &prefix); if (ret == 0) { diff --git a/babeld/babeld.c b/babeld/babeld.c index 09955cfbef..895ede7040 100644 --- a/babeld/babeld.c +++ b/babeld/babeld.c @@ -317,13 +317,9 @@ babel_clean_routing_process(void) flush_all_routes(); babel_interface_close_all(); - /* cancel threads */ - if (babel_routing_process->t_read != NULL) { - thread_cancel(babel_routing_process->t_read); - } - if (babel_routing_process->t_update != NULL) { - thread_cancel(babel_routing_process->t_update); - } + /* cancel events */ + thread_cancel(&babel_routing_process->t_read); + thread_cancel(&babel_routing_process->t_update); distribute_list_delete(&babel_routing_process->distribute_ctx); XFREE(MTYPE_BABEL, babel_routing_process); @@ -503,9 +499,7 @@ static void babel_set_timer(struct timeval *timeout) { long msecs = timeout->tv_sec * 1000 + timeout->tv_usec / 1000; - if (babel_routing_process->t_update != NULL) { - thread_cancel(babel_routing_process->t_update); - } + thread_cancel(&(babel_routing_process->t_update)); thread_add_timer_msec(master, babel_main_loop, NULL, msecs, &babel_routing_process->t_update); } |
