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 <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-11-14 18:58:11 +00:00
parent 6d737a7607
commit 444815f964
No known key found for this signature in database
GPG key ID: A9553245FDE9B739

View file

@ -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;
}