From: Roy Marples Date: Tue, 20 Jan 2009 16:02:46 +0000 (+0000) Subject: Ensure we have a state when comparing X-Git-Tag: v5.0.0~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d600f7076c1acdb0e9c7df6525590bc9921b109b;p=thirdparty%2Fdhcpcd.git Ensure we have a state when comparing --- diff --git a/if-pref.c b/if-pref.c index 7a47833d..56f01132 100644 --- a/if-pref.c +++ b/if-pref.c @@ -36,6 +36,12 @@ ifcmp(struct interface *si, struct interface *ti) { int sill, till; + if (si->state && !ti->state) + return -1; + if (!si->state && ti->state) + return 1; + if (!si->state && !ti->state) + return 0; /* If one has a lease and the other not, it takes precedence. */ if (si->state->new && !ti->state->new) return -1;