mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix man page re interface labels and add warning when used badly.
This commit is contained in:
committed by
Simon Kelley
parent
16f03e7139
commit
ad59f278c6
@@ -203,12 +203,17 @@ or
|
|||||||
options are given dnsmasq listens on all available interfaces except any
|
options are given dnsmasq listens on all available interfaces except any
|
||||||
given in
|
given in
|
||||||
.B \--except-interface
|
.B \--except-interface
|
||||||
options. IP alias interfaces (eg "eth1:0") cannot be used with
|
options. On Linux, when
|
||||||
.B --interface
|
.B \--bind-interfaces
|
||||||
or
|
or
|
||||||
.B --except-interface
|
.B \--bind-dynamic
|
||||||
options, use --listen-address instead. A simple wildcard, consisting
|
are in effect, IP alias interface labels (eg "eth1:0") are checked, rather than
|
||||||
of a trailing '*', can be used in
|
interface names. In the degenerate case when an interface has one address, this amounts to the same thing but when an interface has multiple addresses it
|
||||||
|
allows control over which of those addresses are accepted.
|
||||||
|
The same effect is achievable in default mode by using
|
||||||
|
.B \--listen-address.
|
||||||
|
A simple wildcard, consisting of a trailing '*',
|
||||||
|
can be used in
|
||||||
.B \--interface
|
.B \--interface
|
||||||
and
|
and
|
||||||
.B \--except-interface
|
.B \--except-interface
|
||||||
@@ -222,7 +227,9 @@ and
|
|||||||
.B --except-interface
|
.B --except-interface
|
||||||
options does not matter and that
|
options does not matter and that
|
||||||
.B --except-interface
|
.B --except-interface
|
||||||
options always override the others.
|
options always override the others. The comments about interface labels for
|
||||||
|
.B --listen-address
|
||||||
|
apply here.
|
||||||
.TP
|
.TP
|
||||||
.B --auth-server=<domain>,<interface>|<ip-address>
|
.B --auth-server=<domain>,<interface>|<ip-address>
|
||||||
Enable DNS authoritative mode for queries arriving at an interface or address. Note that the interface or address
|
Enable DNS authoritative mode for queries arriving at an interface or address. Note that the interface or address
|
||||||
|
|||||||
@@ -771,6 +771,8 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
if (option_bool(OPT_NOWILD))
|
if (option_bool(OPT_NOWILD))
|
||||||
warn_bound_listeners();
|
warn_bound_listeners();
|
||||||
|
else if (!option_bool(OPT_CLEVERBIND))
|
||||||
|
warn_wild_labels();
|
||||||
|
|
||||||
warn_int_names();
|
warn_int_names();
|
||||||
|
|
||||||
|
|||||||
@@ -522,7 +522,7 @@ struct ipsets {
|
|||||||
struct irec {
|
struct irec {
|
||||||
union mysockaddr addr;
|
union mysockaddr addr;
|
||||||
struct in_addr netmask; /* only valid for IPv4 */
|
struct in_addr netmask; /* only valid for IPv4 */
|
||||||
int tftp_ok, dhcp_ok, mtu, done, warned, dad, dns_auth, index, multicast_done, found;
|
int tftp_ok, dhcp_ok, mtu, done, warned, dad, dns_auth, index, multicast_done, found, label;
|
||||||
char *name;
|
char *name;
|
||||||
struct irec *next;
|
struct irec *next;
|
||||||
};
|
};
|
||||||
@@ -1252,6 +1252,7 @@ int enumerate_interfaces(int reset);
|
|||||||
void create_wildcard_listeners(void);
|
void create_wildcard_listeners(void);
|
||||||
void create_bound_listeners(int die);
|
void create_bound_listeners(int die);
|
||||||
void warn_bound_listeners(void);
|
void warn_bound_listeners(void);
|
||||||
|
void warn_wild_labels(void);
|
||||||
void warn_int_names(void);
|
void warn_int_names(void);
|
||||||
int is_dad_listeners(void);
|
int is_dad_listeners(void);
|
||||||
int iface_check(int family, struct all_addr *addr, char *name, int *auth_dns);
|
int iface_check(int family, struct all_addr *addr, char *name, int *auth_dns);
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
|
|||||||
int tftp_ok = !!option_bool(OPT_TFTP);
|
int tftp_ok = !!option_bool(OPT_TFTP);
|
||||||
int dhcp_ok = 1;
|
int dhcp_ok = 1;
|
||||||
int auth_dns = 0;
|
int auth_dns = 0;
|
||||||
|
int is_label = 0;
|
||||||
#if defined(HAVE_DHCP) || defined(HAVE_TFTP)
|
#if defined(HAVE_DHCP) || defined(HAVE_TFTP)
|
||||||
struct iname *tmp;
|
struct iname *tmp;
|
||||||
#endif
|
#endif
|
||||||
@@ -264,6 +265,8 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
|
|||||||
|
|
||||||
if (!label)
|
if (!label)
|
||||||
label = ifr.ifr_name;
|
label = ifr.ifr_name;
|
||||||
|
else
|
||||||
|
is_label = strcmp(label, ifr.ifr_name);
|
||||||
|
|
||||||
/* maintain a list of all addresses on all interfaces for --local-service option */
|
/* maintain a list of all addresses on all interfaces for --local-service option */
|
||||||
if (option_bool(OPT_LOCAL_SERVICE))
|
if (option_bool(OPT_LOCAL_SERVICE))
|
||||||
@@ -482,6 +485,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
|
|||||||
iface->found = 1;
|
iface->found = 1;
|
||||||
iface->done = iface->multicast_done = iface->warned = 0;
|
iface->done = iface->multicast_done = iface->warned = 0;
|
||||||
iface->index = if_index;
|
iface->index = if_index;
|
||||||
|
iface->label = is_label;
|
||||||
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
||||||
{
|
{
|
||||||
strcpy(iface->name, ifr.ifr_name);
|
strcpy(iface->name, ifr.ifr_name);
|
||||||
@@ -1034,6 +1038,15 @@ void warn_bound_listeners(void)
|
|||||||
my_syslog(LOG_WARNING, _("LOUD WARNING: use --bind-dynamic rather than --bind-interfaces to avoid DNS amplification attacks via these interface(s)"));
|
my_syslog(LOG_WARNING, _("LOUD WARNING: use --bind-dynamic rather than --bind-interfaces to avoid DNS amplification attacks via these interface(s)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void warn_wild_labels(void)
|
||||||
|
{
|
||||||
|
struct irec *iface;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
void warn_int_names(void)
|
void warn_int_names(void)
|
||||||
{
|
{
|
||||||
struct interface_name *intname;
|
struct interface_name *intname;
|
||||||
|
|||||||
Reference in New Issue
Block a user