Skip to content

Commit

Permalink
Log which interface is actually used when a different was configured
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Dec 26, 2021
1 parent ea33a01 commit 7932982
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dnsmasq.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ struct irec {
union mysockaddr addr;
struct in_addr netmask; /* only valid for IPv4 */
int tftp_ok, dhcp_ok, mtu, done, warned, dad, dns_auth, index, multicast_done, found, label;
char *name;
char *name, *slabel;
struct irec *next;
};

Expand Down
6 changes: 4 additions & 2 deletions src/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,11 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
iface->done = iface->multicast_done = iface->warned = 0;
iface->index = if_index;
iface->label = is_label;
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
if ((iface->slabel = whine_malloc(strlen(label)+1)) &&
(iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
{
strcpy(iface->name, ifr.ifr_name);
strcpy(iface->slabel, label);
iface->next = daemon->interfaces;
daemon->interfaces = iface;
return 1;
Expand Down Expand Up @@ -1221,7 +1223,7 @@ void warn_wild_labels(void)

for (iface = daemon->interfaces; iface; iface = iface->next)
if (iface->found && iface->name && iface->label)
my_syslog(LOG_WARNING, _("warning: using interface %s instead"), iface->name);
my_syslog(LOG_WARNING, _("warning: using interface %s instead of %s"), iface->name, iface->slabel);
}

void warn_int_names(void)
Expand Down

0 comments on commit 7932982

Please sign in to comment.