summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2023-03-16 15:16:17 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2023-03-16 15:16:17 +0000
commit946180701191ea7e552fa5a939140a635d47b566 (patch)
tree5005035c99151c2eaa8353a35ba9ae2ae77dff04
parent00be8b39e240934e404533deda08cbae2aae25a8 (diff)
downloaddnsmasq-946180701191ea7e552fa5a939140a635d47b566.tar.gz
Remove limitation on --dynamic-host.
Dynamic-host was implemented to ignore interface addresses with /32 (or /128 for IPv6) prefix lengths, since they are not useful for synthesising addresses. Due to a bug before 2.88, this didn't work for IPv4, and some have used --dynamic-host=example.com,0.0.0.0,eth0 to do the equivalent of --interface-name for such interfaces. When the bug was fixed in 2.88 these uses broke. Since this behaviour seems to violate the principle of least surprise, and since the 2.88 fix is breaking existing imstallations, this commit removes the check on /32 and /128 prefix lengths to solve both problems.
-rw-r--r--src/network.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/network.c b/src/network.c
index 1e41a78..a80d096 100644
--- a/src/network.c
+++ b/src/network.c
@@ -359,13 +359,8 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
struct in_addr newaddr = addr->in.sin_addr;
if (int_name->flags & INP4)
- {
- if (netmask.s_addr == 0xffffffff)
- continue;
-
- newaddr.s_addr = (addr->in.sin_addr.s_addr & netmask.s_addr) |
- (int_name->proto4.s_addr & ~netmask.s_addr);
- }
+ newaddr.s_addr = (addr->in.sin_addr.s_addr & netmask.s_addr) |
+ (int_name->proto4.s_addr & ~netmask.s_addr);
/* check for duplicates. */
for (lp = int_name->addr; lp; lp = lp->next)
@@ -398,10 +393,6 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
{
int i;
- /* No sense in doing /128. */
- if (prefixlen == 128)
- continue;
-
for (i = 0; i < 16; i++)
{
int bits = ((i+1)*8) - prefixlen;