Skip to content

Commit 33605d7

Browse files
committed
Log which interface is actually used when a different was configured
Signed-off-by: DL6ER <[email protected]>
1 parent 8cfcd9f commit 33605d7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/dnsmasq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ struct irec {
632632
union mysockaddr addr;
633633
struct in_addr netmask; /* only valid for IPv4 */
634634
int tftp_ok, dhcp_ok, mtu, done, warned, dad, dns_auth, index, multicast_done, found, label;
635-
char *name;
635+
char *name, *slabel;
636636
struct irec *next;
637637
};
638638

src/network.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,11 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
544544
iface->done = iface->multicast_done = iface->warned = 0;
545545
iface->index = if_index;
546546
iface->label = is_label;
547-
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
547+
if ((iface->slabel = whine_malloc(strlen(label)+1)) &&
548+
(iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
548549
{
549550
strcpy(iface->name, ifr.ifr_name);
551+
strcpy(iface->slabel, label);
550552
iface->next = daemon->interfaces;
551553
daemon->interfaces = iface;
552554
return 1;
@@ -1221,7 +1223,7 @@ void warn_wild_labels(void)
12211223

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

12271229
void warn_int_names(void)

0 commit comments

Comments
 (0)