dhclient - Make sure an interface is registered before we start using it.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Thu, 2 Aug 2012 18:15:28 +0000 (20:15 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sun, 19 Aug 2012 14:30:34 +0000 (16:30 +0200)
Taken-from: OpenBSD

sbin/dhclient/dispatch.c

index 3c021b4..7968d24 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: src/sbin/dhclient/dispatch.c,v 1.47 2010/07/02 22:03:27 deraadt Exp $ */
+/*     $OpenBSD: src/sbin/dhclient/dispatch.c,v 1.49 2010/10/23 14:26:57 phessler Exp $        */
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -132,6 +132,9 @@ dispatch(void)
                 * a timeout registered, time out the select call then.
                 */
 another:
                 * a timeout registered, time out the select call then.
                 */
 another:
+               if (!ifi)
+                       error("No interfaces available");
+
                if (!ifi->linkstat)
                        interfaces_invalidated = 0;
 
                if (!ifi->linkstat)
                        interfaces_invalidated = 0;