]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix test for preferring a fake lease vs a real one.
authorDavid Binderman <dcb314@hotmail.com>
Thu, 4 May 2017 07:52:41 +0000 (08:52 +0100)
committerRoy Marples <roy@marples.name>
Thu, 4 May 2017 07:52:41 +0000 (08:52 +0100)
src/ipv4.c

index 50c524262f6758eac1db4fca13067d513d748a07..224e8abf686d43b82b5bb52e10721d97d18ac546 100644 (file)
@@ -229,9 +229,9 @@ ipv4_ifcmp(const struct interface *si, const struct interface *ti)
        if (!sis->new && tis->new)
                return 1;
        /* Always prefer proper leases */
-       if (!(sis->added & STATE_FAKE) && (sis->added & STATE_FAKE))
+       if (!(sis->added & STATE_FAKE) && (tis->added & STATE_FAKE))
                return -1;
-       if ((sis->added & STATE_FAKE) && !(sis->added & STATE_FAKE))
+       if ((sis->added & STATE_FAKE) && !(tis->added & STATE_FAKE))
                return 1;
        /* If we are either, they neither have a lease, or they both have.
         * We need to check for IPv4LL and make it non-preferred. */