From 444815f964d6d61ca271b50246d88fed0e3d7bac Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 14 Nov 2017 18:58:11 +0000 Subject: [PATCH] orther: fix xstrstr_init() memcmp() return value usage This is a bug. The xstrstr_init initialized wrong IP version functions when this function was the first to run and set function pointers. Signed-off-by: Sami Kerola --- src/other.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/other.c b/src/other.c index 5467fb1..aea5aa8 100644 --- a/src/other.c +++ b/src/other.c @@ -354,11 +354,11 @@ double get_range_size_v6(const struct range_t *r) */ int xstrstr_init(struct conf_t *state, const char *restrict str) { - if (memcmp("lease ", str, 6)) { + if (!memcmp("lease ", str, 6)) { set_ipv_functions(state, IPv4); return PREFIX_LEASE; } - if (memcmp(" iaaddr ", str, 9)) { + if (!memcmp(" iaaddr ", str, 9)) { set_ipv_functions(state, IPv6); return PREFIX_LEASE; }