Added
Link Here
|
1 |
From 26bbf5a314d833beaf0f147d24409969f05f3dba Mon Sep 17 00:00:00 2001 |
2 |
From: Simon Kelley <simon@thekelleys.org.uk> |
3 |
Date: Thu, 23 Sep 2021 10:54:46 +0100 |
4 |
Subject: [PATCH] Fix --address=/#/...... which was lost in 2.86 |
5 |
|
6 |
A victim of the domain-search rewrite. Apologies. |
7 |
--- |
8 |
CHANGELOG | 8 ++++++++ |
9 |
src/network.c | 3 ++- |
10 |
src/option.c | 17 ++++++++++++----- |
11 |
3 files changed, 22 insertions(+), 6 deletions(-) |
12 |
|
13 |
diff --git a/CHANGELOG b/CHANGELOG |
14 |
index 5e54df9..8652dd8 100644 |
15 |
--- a/CHANGELOG |
16 |
+++ b/CHANGELOG |
17 |
@@ -1,3 +1,11 @@ |
18 |
+version 2.87 |
19 |
+ Allow arbitrary prefix lengths in --rev-server and |
20 |
+ --domain=....,local |
21 |
+ |
22 |
+ Replace --address=/#/..... functionality which got |
23 |
+ missed in the 2.86 domain search rewrite. |
24 |
+ |
25 |
+ |
26 |
version 2.86 |
27 |
Handle DHCPREBIND requests in the DHCPv6 server code. |
28 |
Thanks to Aichun Li for spotting this omission, and the initial |
29 |
diff --git a/src/network.c b/src/network.c |
30 |
index 296c7bd..3c1c176 100644 |
31 |
--- a/src/network.c |
32 |
+++ b/src/network.c |
33 |
@@ -1626,7 +1626,8 @@ void check_servers(int no_loop_check) |
34 |
continue; |
35 |
|
36 |
if ((serv->flags & SERV_LITERAL_ADDRESS) && |
37 |
- !(serv->flags & (SERV_6ADDR | SERV_4ADDR | SERV_ALL_ZEROS))) |
38 |
+ !(serv->flags & (SERV_6ADDR | SERV_4ADDR | SERV_ALL_ZEROS)) && |
39 |
+ strlen(serv->domain)) |
40 |
{ |
41 |
count--; |
42 |
if (++locals <= LOCALS_LOGGED) |
43 |
diff --git a/src/option.c b/src/option.c |
44 |
index e64c3ab..54d89aa 100644 |
45 |
--- a/src/option.c |
46 |
+++ b/src/option.c |
47 |
@@ -2764,7 +2764,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma |
48 |
|
49 |
if (!arg || !*arg) |
50 |
flags = SERV_LITERAL_ADDRESS; |
51 |
- else if (option == 'A') |
52 |
+ else if (option != 'S') |
53 |
{ |
54 |
/* # as literal address means return zero address for 4 and 6 */ |
55 |
if (strcmp(arg, "#") == 0) |
56 |
@@ -2788,11 +2788,18 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma |
57 |
while (1) |
58 |
{ |
59 |
/* server=//1.2.3.4 is special. */ |
60 |
- if (strlen(domain) == 0 && lastdomain) |
61 |
- flags |= SERV_FOR_NODOTS; |
62 |
- else |
63 |
- flags &= ~SERV_FOR_NODOTS; |
64 |
+ if (lastdomain) |
65 |
+ { |
66 |
+ if (strlen(domain) == 0) |
67 |
+ flags |= SERV_FOR_NODOTS; |
68 |
+ else |
69 |
+ flags &= ~SERV_FOR_NODOTS; |
70 |
|
71 |
+ /* address=/#/ matches the same as without domain */ |
72 |
+ if (option != 'S' && domain[0] == '#' && domain[1] == 0) |
73 |
+ domain[0] = 0; |
74 |
+ } |
75 |
+ |
76 |
if (!add_update_server(flags, &serv_addr, &source_addr, interface, domain, &addr)) |
77 |
ret_err(gen_err); |
78 |
|
79 |
-- |
80 |
2.20.1 |
81 |
|