summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_routemap.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-01-28 00:56:30 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-01-28 00:56:30 +0100
commit17a217216d2a3be320c7e4694656bf8fcc4c5b0d (patch)
tree89df98a325b75de8c940ef3fdface619253ea462 /zebra/zebra_routemap.c
parentMerge pull request #1659 from chiragshah6/ospf_vrf_dev (diff)
downloadfrr-17a217216d2a3be320c7e4694656bf8fcc4c5b0d.tar.xz
frr-17a217216d2a3be320c7e4694656bf8fcc4c5b0d.zip
zebra: Fix failure to parse src
If src happens to point at all 0's due to not initializing it and if the address passed in is not a v6 address then we would not set src in the AF_INET6 call and would fail the (src.ipv4.s_addr && inet_pton(AF_INET...) call. Thus causing us to return a NULL and make the routemap code think there was an issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_routemap.c')
-rw-r--r--zebra/zebra_routemap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 89cb2fc48..4c619e578 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -1193,7 +1193,7 @@ static void *route_set_src_compile(const char *arg)
union g_addr src, *psrc;
if ((inet_pton(AF_INET6, arg, &src.ipv6) == 1)
- || (src.ipv4.s_addr && (inet_pton(AF_INET, arg, &src.ipv4) == 1))) {
+ || (inet_pton(AF_INET, arg, &src.ipv4) == 1)) {
psrc = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(union g_addr));
*psrc = src;
return psrc;