Fix un-initialised "used" field in --listen-address structure.
Also remove unused "isloop" field.
diff --git a/src/dnsmasq.h b/src/dnsmasq.h
index 689d29b..dc2d294 100644
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -425,7 +425,7 @@
struct iname {
char *name;
union mysockaddr addr;
- int isloop, used;
+ int used;
struct iname *next;
};
diff --git a/src/network.c b/src/network.c
index 063f470..cae45c7 100644
--- a/src/network.c
+++ b/src/network.c
@@ -207,17 +207,14 @@
struct iname *lo;
for (lo = daemon->if_names; lo; lo = lo->next)
if (lo->name && strcmp(lo->name, ifr.ifr_name) == 0)
- {
- lo->isloop = 1;
- break;
- }
+ break;
if (!lo &&
(lo = whine_malloc(sizeof(struct iname))) &&
(lo->name = whine_malloc(strlen(ifr.ifr_name)+1)))
{
strcpy(lo->name, ifr.ifr_name);
- lo->isloop = lo->used = 1;
+ lo->used = 1;
lo->next = daemon->if_names;
daemon->if_names = lo;
}
diff --git a/src/option.c b/src/option.c
index 0014269..77c0d5a 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1570,7 +1570,7 @@
/* new->name may be NULL if someone does
"interface=" to disable all interfaces except loop. */
new->name = opt_string_alloc(arg);
- new->isloop = new->used = 0;
+ new->used = 0;
arg = comma;
} while (arg);
break;
@@ -1640,7 +1640,8 @@
option = '?'; /* error */
break;
}
-
+
+ new->used = 0;
daemon->if_addrs = new;
arg = comma;
} while (arg);