diff options
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/zebra_routemap.c | 11 | ||||
-rw-r--r-- | zebra/zserv.c | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 808dcf74..b3111b8e 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -642,17 +642,14 @@ route_set_src (void *rule, struct prefix *prefix, static void * route_set_src_compile (const char *arg) { - sa_family_t family; union g_addr src, *psrc; - if (inet_pton(AF_INET, arg, &src.ipv4) > 0) - family = AF_INET; + if (inet_pton(AF_INET, arg, &src.ipv4) != 1 #ifdef HAVE_IPV6 - else if (inet_pton(AF_INET6, arg, &src.ipv6) > 0) - family = AF_INET6; + && inet_pton(AF_INET6, arg, &src.ipv6) != 1 #endif /* HAVE_IPV6 */ - else - return NULL; + ) + return NULL; psrc = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (union g_addr)); *psrc = src; diff --git a/zebra/zserv.c b/zebra/zserv.c index cb5e411c..dc3d432b 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -451,7 +451,7 @@ zsend_route_multipath (int cmd, struct zserv *client, struct prefix *p, } /* Metric */ - if (cmd == ZEBRA_IPV4_ROUTE_ADD || ZEBRA_IPV6_ROUTE_ADD) + if (cmd == ZEBRA_IPV4_ROUTE_ADD || cmd == ZEBRA_IPV6_ROUTE_ADD) { SET_FLAG (zapi_flags, ZAPI_MESSAGE_DISTANCE); stream_putc (s, rib->distance); |