mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix un-initialised "used" field in --listen-address structure.
Also remove unused "isloop" field.
This commit is contained in:
@@ -425,7 +425,7 @@ struct listener {
|
|||||||
struct iname {
|
struct iname {
|
||||||
char *name;
|
char *name;
|
||||||
union mysockaddr addr;
|
union mysockaddr addr;
|
||||||
int isloop, used;
|
int used;
|
||||||
struct iname *next;
|
struct iname *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -207,17 +207,14 @@ static int iface_allowed(struct irec **irecp, int if_index,
|
|||||||
struct iname *lo;
|
struct iname *lo;
|
||||||
for (lo = daemon->if_names; lo; lo = lo->next)
|
for (lo = daemon->if_names; lo; lo = lo->next)
|
||||||
if (lo->name && strcmp(lo->name, ifr.ifr_name) == 0)
|
if (lo->name && strcmp(lo->name, ifr.ifr_name) == 0)
|
||||||
{
|
break;
|
||||||
lo->isloop = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!lo &&
|
if (!lo &&
|
||||||
(lo = whine_malloc(sizeof(struct iname))) &&
|
(lo = whine_malloc(sizeof(struct iname))) &&
|
||||||
(lo->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
(lo->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
||||||
{
|
{
|
||||||
strcpy(lo->name, ifr.ifr_name);
|
strcpy(lo->name, ifr.ifr_name);
|
||||||
lo->isloop = lo->used = 1;
|
lo->used = 1;
|
||||||
lo->next = daemon->if_names;
|
lo->next = daemon->if_names;
|
||||||
daemon->if_names = lo;
|
daemon->if_names = lo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1570,7 +1570,7 @@ static char *one_opt(int option, char *arg, char *gen_prob, int command_line)
|
|||||||
/* new->name may be NULL if someone does
|
/* new->name may be NULL if someone does
|
||||||
"interface=" to disable all interfaces except loop. */
|
"interface=" to disable all interfaces except loop. */
|
||||||
new->name = opt_string_alloc(arg);
|
new->name = opt_string_alloc(arg);
|
||||||
new->isloop = new->used = 0;
|
new->used = 0;
|
||||||
arg = comma;
|
arg = comma;
|
||||||
} while (arg);
|
} while (arg);
|
||||||
break;
|
break;
|
||||||
@@ -1640,7 +1640,8 @@ static char *one_opt(int option, char *arg, char *gen_prob, int command_line)
|
|||||||
option = '?'; /* error */
|
option = '?'; /* error */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new->used = 0;
|
||||||
daemon->if_addrs = new;
|
daemon->if_addrs = new;
|
||||||
arg = comma;
|
arg = comma;
|
||||||
} while (arg);
|
} while (arg);
|
||||||
|
|||||||
Reference in New Issue
Block a user