Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log which interface is actually used when a different was configured #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 6 additions & 4 deletions src/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
}
else
for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
if (tmp->name && wildcard_match(tmp->name, ifr.ifr_name))
if (tmp->name && wildcard_match(tmp->name, label))
{
tftp_ok = 0;
dhcp_ok = 0;
Expand All @@ -520,7 +520,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
/* dedicated tftp interface list */
tftp_ok = 0;
for (tmp = daemon->tftp_interfaces; tmp; tmp = tmp->next)
if (tmp->name && wildcard_match(tmp->name, ifr.ifr_name))
if (tmp->name && wildcard_match(tmp->name, label))
tftp_ok = 1;
}
#endif
Expand All @@ -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