diff options
| author | Roy Marples <roy@marples.name> | 2009-01-20 16:02:46 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-01-20 16:02:46 +0000 |
| commit | d600f7076c1acdb0e9c7df6525590bc9921b109b (patch) | |
| tree | f026c5f1107eba010bcbc98fd381d004fe2b8bbe /if-pref.c | |
| parent | 882d97c856abe553fdc752457006ee85798adae1 (diff) | |
| download | dhcpcd-d600f7076c1acdb0e9c7df6525590bc9921b109b.tar.xz | |
Ensure we have a state when comparing
Diffstat (limited to 'if-pref.c')
| -rw-r--r-- | if-pref.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |
