Log which interface is actually used when a different was configured

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
Dominik Derigs
2021-12-26 10:29:14 +01:00
committed by DL6ER
parent 8cfcd9ff63
commit 33605d70b0
2 changed files with 5 additions and 3 deletions

View File

@@ -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;
};

View File

@@ -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;
@@ -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)