From 8584c502d37627d8abe18213771b5f4f98cb4aa3 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Thu, 10 Oct 2013 21:15:23 +0100 Subject: [PATCH] Don't do bindtodevice if --interface option not given. --- src/dhcp-common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dhcp-common.c b/src/dhcp-common.c index ecdb448..304c47e 100644 --- a/src/dhcp-common.c +++ b/src/dhcp-common.c @@ -453,14 +453,17 @@ void bindtodevice(int fd) individual processes don't always see the packets they should. SO_BINDTODEVICE is only available Linux. - Note that if wildcards are used in --interface, or a configured interface doesn't - yet exist, then more interfaces may arrive later, so we can't safely assert there - is only one interface and proceed. + Note that if wildcards are used in --interface, or --interface is not used at all, + or a configured interface doesn't yet exist, then more interfaces may arrive later, + so we can't safely assert there is only one interface and proceed. */ struct irec *iface, *found; struct iname *if_tmp; + if (!daemon->if_names) + return; + for (if_tmp = daemon->if_names; if_tmp; if_tmp = if_tmp->next) if (if_tmp->name && (!if_tmp->used || strchr(if_tmp->name, '*'))) return;