]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Always prefer master interfaces
authorRoy Marples <roy@marples.name>
Wed, 18 Mar 2015 11:54:23 +0000 (11:54 +0000)
committerRoy Marples <roy@marples.name>
Wed, 18 Mar 2015 11:54:23 +0000 (11:54 +0000)
if.c

diff --git a/if.c b/if.c
index 9b013905e0dc12d706cc90d8eeee4eb53c92845d..e3c16eb96d948869c454e07c0a1b84df4583facf 100644 (file)
--- a/if.c
+++ b/if.c
@@ -596,6 +596,14 @@ if_cmp(const struct interface *si, const struct interface *ti)
        int r;
 #endif
 
+       /* Always prefer master interfaces */
+       if (!(si->options->options & DHCPCD_PFXDLGONLY) &&
+           ti->options->options & DHCPCD_PFXDLGONLY)
+               return -1;
+       if (si->options->options & DHCPCD_PFXDLGONLY &&
+           !(ti->options->options & DHCPCD_PFXDLGONLY))
+               return 1;
+
        if (D_STATE_RUNNING(si) && !D_STATE_RUNNING(ti))
                return -1;
        if (!D_STATE_RUNNING(si) && D_STATE_RUNNING(ti))