Since all static leases are in one file, /etc/dhclient.conf, there is no
authorkrw <krw@openbsd.org>
Mon, 12 May 2014 13:12:41 +0000 (13:12 +0000)
committerkrw <krw@openbsd.org>
Mon, 12 May 2014 13:12:41 +0000 (13:12 +0000)
'wrong interface' specification. So display that error message only for
non-static leases. i.e. when reading /var/db/dhclient.leases.<if>.

sbin/dhclient/clparse.c

index ebbda2c..b5f06fb 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clparse.c,v 1.86 2014/05/11 12:40:37 krw Exp $        */
+/*     $OpenBSD: clparse.c,v 1.87 2014/05/12 13:12:41 krw Exp $        */
 
 /* Parser for dhclient config and lease files. */
 
@@ -536,7 +536,8 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease)
                        return;
                }
                if (strcmp(ifi->name, val) != 0) {
-                       parse_warn("wrong interface name.");
+                       if (lease->is_static == 0)
+                               parse_warn("wrong interface name.");
                        skip_to_semi(cfile);
                        return;
                }