Compare commits
No commits in common. 'c9' and 'c8' have entirely different histories.
@ -1 +1 @@
|
||||
e4338f80bd2118ba1578e4bd3c2c154ec9c12ce0 SOURCES/dhcp-4.4.2b1.tar.gz
|
||||
fb0417530e49368fe032cd9722f51c74f93180ac SOURCES/dhcp-4.3.6.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
SOURCES/dhcp-4.4.2b1.tar.gz
|
||||
SOURCES/dhcp-4.3.6.tar.gz
|
||||
|
@ -1,54 +0,0 @@
|
||||
From ac65289663532db0bc1de449ca2a0eb4c8c2ca6f Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Thu, 21 Feb 2019 10:26:34 +0100
|
||||
Subject: [PATCH 07/26] Change paths to conform to our standards
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
---
|
||||
doc/examples/dhcpd-dhcpv6.conf | 2 +-
|
||||
includes/dhcpd.h | 6 +++---
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/doc/examples/dhcpd-dhcpv6.conf b/doc/examples/dhcpd-dhcpv6.conf
|
||||
index 448a6a6..2357824 100644
|
||||
--- a/doc/examples/dhcpd-dhcpv6.conf
|
||||
+++ b/doc/examples/dhcpd-dhcpv6.conf
|
||||
@@ -43,7 +43,7 @@ option dhcp6.domain-search "test.example.com","example.com";
|
||||
option dhcp6.info-refresh-time 21600;
|
||||
|
||||
# The path of the lease file
|
||||
-dhcpv6-lease-file-name "/usr/local/var/db/dhcpd6.leases";
|
||||
+dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases";
|
||||
|
||||
# Static definition (must be global)
|
||||
host myclient {
|
||||
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
|
||||
index 018fa34..3632a6b 100644
|
||||
--- a/includes/dhcpd.h
|
||||
+++ b/includes/dhcpd.h
|
||||
@@ -1545,7 +1545,7 @@ typedef unsigned char option_mask [16];
|
||||
#else /* !DEBUG */
|
||||
|
||||
#ifndef _PATH_DHCPD_CONF
|
||||
-#define _PATH_DHCPD_CONF "/etc/dhcpd.conf"
|
||||
+#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef _PATH_DHCPD_DB
|
||||
@@ -1567,11 +1567,11 @@ typedef unsigned char option_mask [16];
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef _PATH_DHCLIENT_CONF
|
||||
-#define _PATH_DHCLIENT_CONF "/etc/dhclient.conf"
|
||||
+#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
|
||||
#endif
|
||||
|
||||
#ifndef _PATH_DHCLIENT_SCRIPT
|
||||
-#define _PATH_DHCLIENT_SCRIPT "/sbin/dhclient-script"
|
||||
+#define _PATH_DHCLIENT_SCRIPT "/usr/sbin/dhclient-script"
|
||||
#endif
|
||||
|
||||
#ifndef _PATH_DHCLIENT_PID
|
||||
--
|
||||
2.14.5
|
||||
|
@ -1,27 +0,0 @@
|
||||
From a0a2186ce52a31357d4eb3c32d7d6887e4603814 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Thu, 21 Feb 2019 10:28:13 +0100
|
||||
Subject: [PATCH 09/26] Fix 'garbage in format string' error
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
RHBZ: 450042
|
||||
---
|
||||
common/tables.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/common/tables.c b/common/tables.c
|
||||
index c1aa214..d2294c0 100644
|
||||
--- a/common/tables.c
|
||||
+++ b/common/tables.c
|
||||
@@ -215,7 +215,7 @@ static struct option dhcp_options[] = {
|
||||
{ "name-service-search", "Sa", &dhcp_universe, 117, 1 },
|
||||
#endif
|
||||
{ "subnet-selection", "I", &dhcp_universe, 118, 1 },
|
||||
- { "domain-search", "Dc", &dhcp_universe, 119, 1 },
|
||||
+ { "domain-search", "D", &dhcp_universe, 119, 1 },
|
||||
{ "vivco", "Evendor-class.", &dhcp_universe, 124, 1 },
|
||||
{ "vivso", "Evendor.", &dhcp_universe, 125, 1 },
|
||||
#if 0
|
||||
--
|
||||
2.14.5
|
||||
|
@ -1,32 +0,0 @@
|
||||
From ed7610cdb2e8ebdbaee618e477879e7e008d4f29 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Thu, 21 Feb 2019 10:29:08 +0100
|
||||
Subject: [PATCH 10/26] Handle null timeout
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
Handle cases in add_timeout() where the function is called with a NULL
|
||||
value for the 'when' parameter
|
||||
|
||||
ISC-Bugs: #19867 (rejected)
|
||||
---
|
||||
common/dispatch.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/common/dispatch.c b/common/dispatch.c
|
||||
index 0207ad3..d7fe200 100644
|
||||
--- a/common/dispatch.c
|
||||
+++ b/common/dispatch.c
|
||||
@@ -209,6 +209,10 @@ void add_timeout (when, where, what, ref, unref)
|
||||
isc_interval_t interval;
|
||||
isc_time_t expires;
|
||||
|
||||
+ if (when == NULL) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* See if this timeout supersedes an existing timeout. */
|
||||
t = (struct timeout *)0;
|
||||
for (q = timeouts; q; q = q->next) {
|
||||
--
|
||||
2.14.5
|
||||
|
@ -1,332 +0,0 @@
|
||||
From 3d3e442ed1316930a5360e4d5a56b46a42a29419 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Thu, 21 Feb 2019 10:35:47 +0100
|
||||
Subject: [PATCH 15/26] Add GUID/DUID to dhcpd logs (#1064416)
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
---
|
||||
client/dhclient.c | 75 ++++++++++++++++++++++++++++++++++++++++++----------
|
||||
server/dhcp.c | 78 +++++++++++++++++++++++++++++++++----------------------
|
||||
2 files changed, 108 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||
index dc9080e..8e57da9 100644
|
||||
--- a/client/dhclient.c
|
||||
+++ b/client/dhclient.c
|
||||
@@ -1170,6 +1170,26 @@ main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
+ /* We create a backup seed before rediscovering interfaces in order to
|
||||
+ have a seed built using all of the available interfaces
|
||||
+ It's interesting if required interfaces doesn't let us defined
|
||||
+ a really unique seed due to a lack of valid HW addr later
|
||||
+ (this is the case with DHCP over IB)
|
||||
+ We only use the last device as using a sum could broke the
|
||||
+ uniqueness of the seed among multiple nodes
|
||||
+ */
|
||||
+ unsigned backup_seed = 0;
|
||||
+ for (ip = interfaces; ip; ip = ip -> next) {
|
||||
+ int junk;
|
||||
+ if ( ip -> hw_address.hlen <= sizeof seed )
|
||||
+ continue;
|
||||
+ memcpy (&junk,
|
||||
+ &ip -> hw_address.hbuf [ip -> hw_address.hlen -
|
||||
+ sizeof seed], sizeof seed);
|
||||
+ backup_seed = junk;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
/* At this point, all the interfaces that the script thinks
|
||||
are relevant should be running, so now we once again call
|
||||
discover_interfaces(), and this time ask it to actually set
|
||||
@@ -1184,14 +1204,36 @@ main(int argc, char **argv) {
|
||||
Not much entropy, but we're booting, so we're not likely to
|
||||
find anything better. */
|
||||
seed = 0;
|
||||
+ int seed_flag = 0;
|
||||
for (ip = interfaces; ip; ip = ip->next) {
|
||||
int junk;
|
||||
+ if ( ip -> hw_address.hlen <= sizeof seed )
|
||||
+ continue;
|
||||
memcpy(&junk,
|
||||
&ip->hw_address.hbuf[ip->hw_address.hlen -
|
||||
sizeof seed], sizeof seed);
|
||||
seed += junk;
|
||||
+ seed_flag = 1;
|
||||
}
|
||||
- srandom(seed + cur_time + (unsigned)getpid());
|
||||
+ if ( seed_flag == 0 ) {
|
||||
+ if ( backup_seed != 0 ) {
|
||||
+ seed = backup_seed;
|
||||
+ log_info ("xid: rand init seed (0x%x) built using all"
|
||||
+ " available interfaces",seed);
|
||||
+ }
|
||||
+ else {
|
||||
+ seed = cur_time^((unsigned) gethostid()) ;
|
||||
+ log_info ("xid: warning: no netdev with useable HWADDR found"
|
||||
+ " for seed's uniqueness enforcement");
|
||||
+ log_info ("xid: rand init seed (0x%x) built using gethostid",
|
||||
+ seed);
|
||||
+ }
|
||||
+ /* we only use seed and no current time as a broadcast reply */
|
||||
+ /* will certainly be used by the hwaddrless interface */
|
||||
+ srandom(seed + ((unsigned)(cur_tv.tv_usec * 1000000)) + (unsigned)getpid());
|
||||
+ }
|
||||
+ else
|
||||
+ srandom(seed + ((unsigned)(cur_tv.tv_usec * 1000000)) + (unsigned)getpid());
|
||||
|
||||
/* Setup specific Infiniband options */
|
||||
for (ip = interfaces; ip; ip = ip->next) {
|
||||
@@ -1746,10 +1788,10 @@ void dhcpack (packet)
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
-
|
||||
- log_info ("DHCPACK of %s from %s",
|
||||
- inet_ntoa(packet->raw->yiaddr),
|
||||
- piaddr (packet->client_addr));
|
||||
+ log_info ("DHCPACK of %s from %s (xid=0x%x)",
|
||||
+ inet_ntoa(packet->raw->yiaddr),
|
||||
+ piaddr (packet -> client_addr),
|
||||
+ ntohl(client -> xid));
|
||||
|
||||
lease = packet_to_lease (packet, client);
|
||||
if (!lease) {
|
||||
@@ -2669,7 +2711,7 @@ void dhcpnak (packet)
|
||||
return;
|
||||
}
|
||||
|
||||
- log_info ("DHCPNAK from %s", piaddr (packet -> client_addr));
|
||||
+ log_info ("DHCPNAK from %s (xid=0x%x)", piaddr (packet -> client_addr), ntohl(client -> xid));
|
||||
|
||||
if (!client -> active) {
|
||||
#if defined (DEBUG)
|
||||
@@ -2802,10 +2844,10 @@ void send_discover (cpp)
|
||||
(long)(client -> interval));
|
||||
} else
|
||||
#endif
|
||||
- log_info ("DHCPDISCOVER on %s to %s port %d interval %ld",
|
||||
+ log_info ("DHCPDISCOVER on %s to %s port %d interval %ld (xid=0x%x)",
|
||||
client -> name ? client -> name : client -> interface -> name,
|
||||
inet_ntoa (sockaddr_broadcast.sin_addr),
|
||||
- ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval));
|
||||
+ ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval), ntohl(client -> xid));
|
||||
|
||||
/* Send out a packet. */
|
||||
#if defined(DHCPv6) && defined(DHCP4o6)
|
||||
@@ -3108,10 +3150,12 @@ void send_request (cpp)
|
||||
}
|
||||
|
||||
strncpy(rip_buf, rip_str, sizeof(rip_buf)-1);
|
||||
- log_info ("DHCPREQUEST for %s on %s to %s port %d", rip_buf,
|
||||
+ log_info ("DHCPREQUEST for %s on %s to %s port %d (xid=0x%x)",
|
||||
+ rip_buf,
|
||||
client->name ? client->name : client->interface->name,
|
||||
inet_ntoa(destination.sin_addr),
|
||||
- ntohs (destination.sin_port));
|
||||
+ ntohs (destination.sin_port),
|
||||
+ ntohl(client -> xid));
|
||||
|
||||
#if defined(DHCPv6) && defined(DHCP4o6)
|
||||
if (dhcpv4_over_dhcpv6) {
|
||||
@@ -3168,11 +3212,13 @@ void send_decline (cpp)
|
||||
log_info ("DHCPDECLINE");
|
||||
} else
|
||||
#endif
|
||||
- log_info ("DHCPDECLINE of %s on %s to %s port %d",
|
||||
+ log_info ("DHCPDECLINE of %s on %s to %s port %d (xid=0x%x)",
|
||||
piaddr(client->requested_address),
|
||||
(client->name ? client->name : client->interface->name),
|
||||
inet_ntoa(sockaddr_broadcast.sin_addr),
|
||||
- ntohs(sockaddr_broadcast.sin_port));
|
||||
+ ntohs(sockaddr_broadcast.sin_port),
|
||||
+ ntohl(client -> xid));
|
||||
+
|
||||
|
||||
/* Send out a packet. */
|
||||
#if defined(DHCPv6) && defined(DHCP4o6)
|
||||
@@ -3231,11 +3277,12 @@ void send_release (cpp)
|
||||
log_info ("DHCPRELEASE");
|
||||
} else
|
||||
#endif
|
||||
- log_info ("DHCPRELEASE of %s on %s to %s port %d",
|
||||
+ log_info ("DHCPRELEASE of %s on %s to %s port %d (xid=0x%x)",
|
||||
piaddr(client->active->address),
|
||||
client->name ? client->name : client->interface->name,
|
||||
inet_ntoa (destination.sin_addr),
|
||||
- ntohs (destination.sin_port));
|
||||
+ ntohs (destination.sin_port),
|
||||
+ ntohl(client -> xid));
|
||||
|
||||
#if defined(DHCPv6) && defined(DHCP4o6)
|
||||
if (dhcpv4_over_dhcpv6) {
|
||||
diff --git a/server/dhcp.c b/server/dhcp.c
|
||||
index 20f2a62..0582c4c 100644
|
||||
--- a/server/dhcp.c
|
||||
+++ b/server/dhcp.c
|
||||
@@ -87,6 +87,42 @@ const int dhcp_type_name_max = ((sizeof dhcp_type_names) / sizeof (char *));
|
||||
|
||||
static TIME leaseTimeCheck(TIME calculated, TIME alternate);
|
||||
|
||||
+char *print_client_identifier_from_packet (packet)
|
||||
+ struct packet *packet;
|
||||
+{
|
||||
+ struct option_cache *oc;
|
||||
+ struct data_string client_identifier;
|
||||
+ char *ci;
|
||||
+
|
||||
+ memset (&client_identifier, 0, sizeof client_identifier);
|
||||
+
|
||||
+ oc = lookup_option (&dhcp_universe, packet -> options,
|
||||
+ DHO_DHCP_CLIENT_IDENTIFIER);
|
||||
+ if (oc &&
|
||||
+ evaluate_option_cache (&client_identifier,
|
||||
+ packet, (struct lease *)0,
|
||||
+ (struct client_state *)0,
|
||||
+ packet -> options,
|
||||
+ (struct option_state *)0,
|
||||
+ &global_scope, oc, MDL)) {
|
||||
+ ci = print_hw_addr (HTYPE_INFINIBAND, client_identifier.len, client_identifier.data);
|
||||
+ data_string_forget (&client_identifier, MDL);
|
||||
+ return ci;
|
||||
+ } else
|
||||
+ return "\"no client id\"";
|
||||
+}
|
||||
+
|
||||
+char *print_hw_addr_or_client_id (packet)
|
||||
+ struct packet *packet;
|
||||
+{
|
||||
+ if (packet -> raw -> htype == HTYPE_INFINIBAND)
|
||||
+ return print_client_identifier_from_packet (packet);
|
||||
+ else
|
||||
+ return print_hw_addr (packet -> raw -> htype,
|
||||
+ packet -> raw -> hlen,
|
||||
+ packet -> raw -> chaddr);
|
||||
+}
|
||||
+
|
||||
void
|
||||
dhcp (struct packet *packet) {
|
||||
int ms_nulltp = 0;
|
||||
@@ -129,9 +165,7 @@ dhcp (struct packet *packet) {
|
||||
|
||||
log_info("%s from %s via %s: %s", s,
|
||||
(packet->raw->htype
|
||||
- ? print_hw_addr(packet->raw->htype,
|
||||
- packet->raw->hlen,
|
||||
- packet->raw->chaddr)
|
||||
+ ? print_hw_addr_or_client_id(packet)
|
||||
: "<no identifier>"),
|
||||
packet->raw->giaddr.s_addr
|
||||
? inet_ntoa(packet->raw->giaddr)
|
||||
@@ -328,9 +362,7 @@ void dhcpdiscover (packet, ms_nulltp)
|
||||
#endif
|
||||
snprintf (msgbuf, sizeof msgbuf, "DHCPDISCOVER from %s %s%s%svia %s",
|
||||
(packet -> raw -> htype
|
||||
- ? print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)
|
||||
+ ? print_hw_addr_or_client_id (packet)
|
||||
: (lease
|
||||
? print_hex_1(lease->uid_len, lease->uid, 60)
|
||||
: "<no identifier>")),
|
||||
@@ -542,9 +574,7 @@ void dhcprequest (packet, ms_nulltp, ip_lease)
|
||||
"DHCPREQUEST for %s%s from %s %s%s%svia %s",
|
||||
piaddr (cip), smbuf,
|
||||
(packet -> raw -> htype
|
||||
- ? print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)
|
||||
+ ? print_hw_addr_or_client_id(packet)
|
||||
: (lease
|
||||
? print_hex_1(lease->uid_len, lease->uid, 60)
|
||||
: "<no identifier>")),
|
||||
@@ -785,9 +815,7 @@ void dhcprelease (packet, ms_nulltp)
|
||||
if ((oc = lookup_option (&dhcp_universe, packet -> options,
|
||||
DHO_DHCP_REQUESTED_ADDRESS))) {
|
||||
log_info ("DHCPRELEASE from %s specified requested-address.",
|
||||
- print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr));
|
||||
+ print_hw_addr_or_client_id(packet));
|
||||
}
|
||||
|
||||
oc = lookup_option (&dhcp_universe, packet -> options,
|
||||
@@ -879,9 +907,7 @@ void dhcprelease (packet, ms_nulltp)
|
||||
"DHCPRELEASE of %s from %s %s%s%svia %s (%sfound)",
|
||||
cstr,
|
||||
(packet -> raw -> htype
|
||||
- ? print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)
|
||||
+ ? print_hw_addr_or_client_id(packet)
|
||||
: (lease
|
||||
? print_hex_1(lease->uid_len, lease->uid, 60)
|
||||
: "<no identifier>")),
|
||||
@@ -986,9 +1012,7 @@ void dhcpdecline (packet, ms_nulltp)
|
||||
"DHCPDECLINE of %s from %s %s%s%svia %s",
|
||||
piaddr (cip),
|
||||
(packet -> raw -> htype
|
||||
- ? print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)
|
||||
+ ? print_hw_addr_or_client_id(packet)
|
||||
: (lease
|
||||
? print_hex_1(lease->uid_len, lease->uid, 60)
|
||||
: "<no identifier>")),
|
||||
@@ -1732,8 +1756,7 @@ void dhcpinform (packet, ms_nulltp)
|
||||
/* Report what we're sending. */
|
||||
snprintf(msgbuf, sizeof msgbuf, "DHCPACK to %s (%s) via", piaddr(cip),
|
||||
(packet->raw->htype && packet->raw->hlen) ?
|
||||
- print_hw_addr(packet->raw->htype, packet->raw->hlen,
|
||||
- packet->raw->chaddr) :
|
||||
+ print_hw_addr_or_client_id(packet) :
|
||||
"<no client hardware address>");
|
||||
log_info("%s %s", msgbuf, gip.len ? piaddr(gip) :
|
||||
packet->interface->name);
|
||||
@@ -1918,9 +1941,7 @@ void nak_lease (packet, cip, network_group)
|
||||
#endif
|
||||
log_info ("DHCPNAK on %s to %s via %s",
|
||||
piaddr (*cip),
|
||||
- print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr),
|
||||
+ print_hw_addr_or_client_id(packet),
|
||||
packet -> raw -> giaddr.s_addr
|
||||
? inet_ntoa (packet -> raw -> giaddr)
|
||||
: packet -> interface -> name);
|
||||
@@ -3936,7 +3957,7 @@ void dhcp_reply (lease)
|
||||
? (state -> offer == DHCPACK ? "DHCPACK" : "DHCPOFFER")
|
||||
: "BOOTREPLY"),
|
||||
piaddr (lease -> ip_addr),
|
||||
- (lease -> hardware_addr.hlen
|
||||
+ (lease -> hardware_addr.hlen > 1
|
||||
? print_hw_addr (lease -> hardware_addr.hbuf [0],
|
||||
lease -> hardware_addr.hlen - 1,
|
||||
&lease -> hardware_addr.hbuf [1])
|
||||
@@ -4497,10 +4518,7 @@ int find_lease (struct lease **lp,
|
||||
if (uid_lease) {
|
||||
if (uid_lease->binding_state == FTS_ACTIVE) {
|
||||
log_error ("client %s has duplicate%s on %s",
|
||||
- (print_hw_addr
|
||||
- (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)),
|
||||
+ (print_hw_addr_or_client_id(packet)),
|
||||
" leases",
|
||||
(ip_lease -> subnet ->
|
||||
shared_network -> name));
|
||||
@@ -4667,9 +4685,7 @@ int find_lease (struct lease **lp,
|
||||
log_error("uid lease %s for client %s is duplicate "
|
||||
"on %s",
|
||||
piaddr(uid_lease->ip_addr),
|
||||
- print_hw_addr(packet->raw->htype,
|
||||
- packet->raw->hlen,
|
||||
- packet->raw->chaddr),
|
||||
+ print_hw_addr_or_client_id(packet),
|
||||
uid_lease->subnet->shared_network->name);
|
||||
|
||||
if (!packet -> raw -> ciaddr.s_addr &&
|
||||
--
|
||||
2.14.5
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 6ea56e988df1da51f7d0bdd8984b38e40102c17b Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Thu, 21 Feb 2019 10:41:14 +0100
|
||||
Subject: [PATCH 19/26] dhclient: write DUID_LLT even in stateless mode
|
||||
(#1156356)
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
(Submitted to dhcp-bugs@isc.org - [ISC-Bugs #38144])
|
||||
---
|
||||
client/dhclient.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||
index 27fde69..4e5546a 100644
|
||||
--- a/client/dhclient.c
|
||||
+++ b/client/dhclient.c
|
||||
@@ -1442,6 +1442,9 @@ void run_stateless(int exit_mode, u_int16_t port)
|
||||
data_string_forget(&default_duid, MDL);
|
||||
|
||||
form_duid(&default_duid, MDL);
|
||||
+ if (form_duid(&default_duid, MDL) == ISC_R_SUCCESS &&
|
||||
+ duid_type == DUID_LLT)
|
||||
+ write_duid(&default_duid);
|
||||
}
|
||||
|
||||
#ifdef DHCP4o6
|
||||
--
|
||||
2.14.5
|
||||
|
@ -1,101 +0,0 @@
|
||||
From 01ce61b8a0331a2f068ca2191bfb897b505c1b9d Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Thu, 21 Feb 2019 10:42:50 +0100
|
||||
Subject: [PATCH 20/26] Discover all hwaddress for xid uniqueness
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
---
|
||||
common/discover.c | 2 ++
|
||||
common/lpf.c | 27 ++++++++++++++++++++++-----
|
||||
includes/dhcpd.h | 3 +++
|
||||
3 files changed, 27 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/common/discover.c b/common/discover.c
|
||||
index 056342c..e66e1c5 100644
|
||||
--- a/common/discover.c
|
||||
+++ b/common/discover.c
|
||||
@@ -648,6 +648,8 @@ discover_interfaces(int state) {
|
||||
interface_dereference(&tmp, MDL);
|
||||
tmp = interfaces; /* XXX */
|
||||
}
|
||||
+ if (tmp != NULL)
|
||||
+ try_hw_addr(tmp);
|
||||
|
||||
if (dhcp_interface_discovery_hook) {
|
||||
(*dhcp_interface_discovery_hook)(tmp);
|
||||
diff --git a/common/lpf.c b/common/lpf.c
|
||||
index b732a86..a708a5d 100644
|
||||
--- a/common/lpf.c
|
||||
+++ b/common/lpf.c
|
||||
@@ -699,8 +699,22 @@ ioctl_get_ll(char *name)
|
||||
return sll;
|
||||
}
|
||||
|
||||
+// define ?
|
||||
+void try_hw_addr(struct interface_info *info){
|
||||
+ get_hw_addr2(info);
|
||||
+};
|
||||
+
|
||||
void
|
||||
get_hw_addr(struct interface_info *info)
|
||||
+{
|
||||
+ if (get_hw_addr2(info) == ISC_R_NOTFOUND){
|
||||
+ log_fatal("Unsupported device type for \"%s\"",
|
||||
+ info->name);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+isc_result_t
|
||||
+get_hw_addr2(struct interface_info *info)
|
||||
{
|
||||
struct hardware *hw = &info->hw_address;
|
||||
char *name = info->name;
|
||||
@@ -710,7 +724,8 @@ get_hw_addr(struct interface_info *info)
|
||||
int sll_allocated = 0;
|
||||
char *dup = NULL;
|
||||
char *colon = NULL;
|
||||
-
|
||||
+ isc_result_t result = ISC_R_SUCCESS;
|
||||
+
|
||||
if (getifaddrs(&ifaddrs) == -1)
|
||||
log_fatal("Failed to get interfaces");
|
||||
|
||||
@@ -794,14 +809,16 @@ get_hw_addr(struct interface_info *info)
|
||||
hw->hbuf[4] = 0xef;
|
||||
break;
|
||||
#endif
|
||||
- default:
|
||||
- freeifaddrs(ifaddrs);
|
||||
- log_fatal("Unsupported device type %hu for \"%s\"",
|
||||
- sll->sll_hatype, name);
|
||||
+ default:
|
||||
+ log_error("Unsupported device type %hu for \"%s\"",
|
||||
+ sll->sll_hatype, name);
|
||||
+ result = ISC_R_NOTFOUND;
|
||||
+
|
||||
}
|
||||
|
||||
if (sll_allocated)
|
||||
dfree(sll, MDL);
|
||||
freeifaddrs(ifaddrs);
|
||||
+ return result;
|
||||
}
|
||||
#endif
|
||||
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
|
||||
index 0c1a0aa..635c510 100644
|
||||
--- a/includes/dhcpd.h
|
||||
+++ b/includes/dhcpd.h
|
||||
@@ -2637,7 +2637,10 @@ void print_dns_status (int, struct dhcp_ddns_cb *, isc_result_t);
|
||||
#endif
|
||||
const char *print_time(TIME);
|
||||
|
||||
+
|
||||
void get_hw_addr(struct interface_info *info);
|
||||
+void try_hw_addr(struct interface_info *info);
|
||||
+isc_result_t get_hw_addr2(struct interface_info *info);
|
||||
char *buf_to_hex (const unsigned char *s, unsigned len,
|
||||
const char *file, int line);
|
||||
char *format_lease_id(const unsigned char *s, unsigned len, int format,
|
||||
--
|
||||
2.14.5
|
||||
|
@ -1,197 +0,0 @@
|
||||
From ef4f5e80d8a1ea1507829ea6f5214f276478f475 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Tue, 22 Oct 2019 16:23:24 +0200
|
||||
Subject: [PATCH 25/27] bind: Detect system time changes
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
---
|
||||
bind/bind/lib/isc/include/isc/result.h | 4 ++-
|
||||
bind/bind/lib/isc/include/isc/util.h | 4 +++
|
||||
bind/bind/lib/isc/result.c | 2 ++
|
||||
bind/bind/lib/isc/unix/app.c | 41 ++++++++++++++++++++++++++++---
|
||||
bind/bind/lib/isc/unix/include/isc/time.h | 20 +++++++++++++++
|
||||
bind/bind/lib/isc/unix/time.c | 22 +++++++++++++++++
|
||||
6 files changed, 89 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/bind/bind/lib/isc/include/isc/result.h b/bind/bind/lib/isc/include/isc/result.h
|
||||
index 0389efa..0e35f98 100644
|
||||
--- a/bind/bind/lib/isc/include/isc/result.h
|
||||
+++ b/bind/bind/lib/isc/include/isc/result.h
|
||||
@@ -89,7 +89,9 @@
|
||||
#define ISC_R_DISCFULL 67 /*%< disc full */
|
||||
#define ISC_R_DEFAULT 68 /*%< default */
|
||||
#define ISC_R_IPV4PREFIX 69 /*%< IPv4 prefix */
|
||||
-#define ISC_R_NRESULTS 70
|
||||
+#define ISC_R_TIMESHIFTED 70 /*%< system time changed */
|
||||
+/*% Not a result code: the number of results. */
|
||||
+#define ISC_R_NRESULTS 71
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
diff --git a/bind/bind/lib/isc/include/isc/util.h b/bind/bind/lib/isc/include/isc/util.h
|
||||
index 973c348..cceeb5e 100644
|
||||
--- a/bind/bind/lib/isc/include/isc/util.h
|
||||
+++ b/bind/bind/lib/isc/include/isc/util.h
|
||||
@@ -289,6 +289,10 @@ extern void mock_assert(const int result, const char* const expression,
|
||||
* Time
|
||||
*/
|
||||
#define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS)
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+#define TIME_MONOTONIC(tp) RUNTIME_CHECK(isc_time_boottime((tp)) == ISC_R_SUCCESS)
|
||||
+#endif
|
||||
+
|
||||
|
||||
/*%
|
||||
* Alignment
|
||||
diff --git a/bind/bind/lib/isc/result.c b/bind/bind/lib/isc/result.c
|
||||
index a9db132..7c04831 100644
|
||||
--- a/bind/bind/lib/isc/result.c
|
||||
+++ b/bind/bind/lib/isc/result.c
|
||||
@@ -105,6 +105,7 @@ static const char *description[ISC_R_NRESULTS] = {
|
||||
"disc full", /*%< 67 */
|
||||
"default", /*%< 68 */
|
||||
"IPv4 prefix", /*%< 69 */
|
||||
+ "time changed", /*%< 70 */
|
||||
};
|
||||
|
||||
static const char *identifier[ISC_R_NRESULTS] = {
|
||||
@@ -178,6 +179,7 @@ static const char *identifier[ISC_R_NRESULTS] = {
|
||||
"ISC_R_DISCFULL",
|
||||
"ISC_R_DEFAULT",
|
||||
"ISC_R_IPV4PREFIX",
|
||||
+ "ISC_R_TIMESHIFTED",
|
||||
};
|
||||
|
||||
#define ISC_RESULT_RESULTSET 2
|
||||
diff --git a/bind/bind/lib/isc/unix/app.c b/bind/bind/lib/isc/unix/app.c
|
||||
index a6e9882..dbd23f7 100644
|
||||
--- a/bind/bind/lib/isc/unix/app.c
|
||||
+++ b/bind/bind/lib/isc/unix/app.c
|
||||
@@ -442,15 +442,51 @@ isc__app_ctxonrun(isc_appctx_t *ctx0, isc_mem_t *mctx, isc_task_t *task,
|
||||
static isc_result_t
|
||||
evloop(isc__appctx_t *ctx) {
|
||||
isc_result_t result;
|
||||
+ isc_time_t now;
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+ isc_time_t monotonic;
|
||||
+ uint64_t diff = 0;
|
||||
+#else
|
||||
+ isc_time_t prev;
|
||||
+ TIME_NOW(&prev);
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+
|
||||
|
||||
while (!ctx->want_shutdown) {
|
||||
int n;
|
||||
- isc_time_t when, now;
|
||||
+ isc_time_t when;
|
||||
+
|
||||
struct timeval tv, *tvp;
|
||||
isc_socketwait_t *swait;
|
||||
bool readytasks;
|
||||
bool call_timer_dispatch = false;
|
||||
|
||||
+ uint64_t us;
|
||||
+
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+ // TBD macros for following three lines
|
||||
+ TIME_NOW(&now);
|
||||
+ TIME_MONOTONIC(&monotonic);
|
||||
+ INSIST(now.seconds > monotonic.seconds)
|
||||
+ us = isc_time_microdiff (&now, &monotonic);
|
||||
+ if (us < diff){
|
||||
+ us = diff - us;
|
||||
+ if (us > 1000000){ // ignoring shifts less than one second
|
||||
+ return ISC_R_TIMESHIFTED;
|
||||
+ };
|
||||
+ diff = isc_time_microdiff (&now, &monotonic);
|
||||
+ } else {
|
||||
+ diff = isc_time_microdiff (&now, &monotonic);
|
||||
+ // not implemented
|
||||
+ }
|
||||
+#else
|
||||
+ TIME_NOW(&now);
|
||||
+ if (isc_time_compare (&now, &prev) < 0)
|
||||
+ return ISC_R_TIMESHIFTED;
|
||||
+ TIME_NOW(&prev);
|
||||
+#endif
|
||||
/*
|
||||
* Check the reload (or suspend) case first for exiting the
|
||||
* loop as fast as possible in case:
|
||||
@@ -475,9 +511,8 @@ evloop(isc__appctx_t *ctx) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
tvp = NULL;
|
||||
else {
|
||||
- uint64_t us;
|
||||
-
|
||||
TIME_NOW(&now);
|
||||
+
|
||||
us = isc_time_microdiff(&when, &now);
|
||||
if (us == 0)
|
||||
call_timer_dispatch = true;
|
||||
diff --git a/bind/bind/lib/isc/unix/include/isc/time.h b/bind/bind/lib/isc/unix/include/isc/time.h
|
||||
index b864c29..5dd43c9 100644
|
||||
--- a/bind/bind/lib/isc/unix/include/isc/time.h
|
||||
+++ b/bind/bind/lib/isc/unix/include/isc/time.h
|
||||
@@ -132,6 +132,26 @@ isc_time_isepoch(const isc_time_t *t);
|
||||
*\li 't' is a valid pointer.
|
||||
*/
|
||||
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+isc_result_t
|
||||
+isc_time_boottime(isc_time_t *t);
|
||||
+/*%<
|
||||
+ * Set 't' to monotonic time from previous boot
|
||||
+ * it's not affected by system time change. It also
|
||||
+ * includes the time system was suspended
|
||||
+ *
|
||||
+ * Requires:
|
||||
+ *\li 't' is a valid pointer.
|
||||
+ *
|
||||
+ * Returns:
|
||||
+ *
|
||||
+ *\li Success
|
||||
+ *\li Unexpected error
|
||||
+ * Getting the time from the system failed.
|
||||
+ */
|
||||
+#endif /* CLOCK_BOOTTIME */
|
||||
+
|
||||
+
|
||||
isc_result_t
|
||||
isc_time_now(isc_time_t *t);
|
||||
/*%<
|
||||
diff --git a/bind/bind/lib/isc/unix/time.c b/bind/bind/lib/isc/unix/time.c
|
||||
index 8edc9df..fe0bb91 100644
|
||||
--- a/bind/bind/lib/isc/unix/time.c
|
||||
+++ b/bind/bind/lib/isc/unix/time.c
|
||||
@@ -498,3 +498,25 @@ isc_time_formatISO8601ms(const isc_time_t *t, char *buf, unsigned int len) {
|
||||
t->nanoseconds / NS_PER_MS);
|
||||
}
|
||||
}
|
||||
+
|
||||
+
|
||||
+#ifdef CLOCK_BOOTTIME
|
||||
+isc_result_t
|
||||
+isc_time_boottime(isc_time_t *t) {
|
||||
+ struct timespec ts;
|
||||
+
|
||||
+ char strbuf[ISC_STRERRORSIZE];
|
||||
+
|
||||
+ if (clock_gettime (CLOCK_BOOTTIME, &ts) != 0){
|
||||
+ isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", strbuf);
|
||||
+ return (ISC_R_UNEXPECTED);
|
||||
+ }
|
||||
+
|
||||
+ t->seconds = ts.tv_sec;
|
||||
+ t->nanoseconds = ts.tv_nsec;
|
||||
+
|
||||
+ return (ISC_R_SUCCESS);
|
||||
+
|
||||
+};
|
||||
+#endif
|
||||
--
|
||||
2.14.5
|
||||
|
@ -1,24 +0,0 @@
|
||||
commit 6acfd3125546a0e5db8fae8a9964cd2f88bf68c0
|
||||
Author: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Tue Oct 22 16:28:04 2019 +0200
|
||||
|
||||
Add dhclient(5) -B option description
|
||||
|
||||
Bug-Url: https://bugzilla.redhat.com/1764088
|
||||
|
||||
diff --git a/client/dhclient.8 b/client/dhclient.8
|
||||
index 0145b9f..5226de5 100644
|
||||
--- a/client/dhclient.8
|
||||
+++ b/client/dhclient.8
|
||||
@@ -552,6 +552,11 @@ Path to the network configuration script invoked by
|
||||
when it gets a lease. If unspecified, the default
|
||||
.B CLIENTBINDIR/dhclient-script
|
||||
is used. See \fBdhclient-script(8)\fR for a description of this file.
|
||||
+.TP
|
||||
+.BI \-B
|
||||
+Always set the bootp broadcast flag in request packets, so that
|
||||
+servers will always broadcast replies. This option is provided as
|
||||
+an extension to enable dhclient to work on IBM s390 Linux guests.
|
||||
.PP
|
||||
.SH PORTS
|
||||
During operations the client may use multiple UDP ports
|
@ -1,118 +0,0 @@
|
||||
From 019021caa791c254a319c71b4f634142dc14b37d Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Tue, 22 Jun 2021 06:58:40 +0200
|
||||
Subject: [PATCH 29/29] Use system getaddrinfo for dhcp
|
||||
Cc: pzhukov@redhat.com
|
||||
|
||||
---
|
||||
bind/bind/lib/irs/include/irs/netdb.h.in | 94 ++++++++++++++++++++++++
|
||||
1 file changed, 94 insertions(+)
|
||||
|
||||
diff --git a/bind/bind/lib/irs/include/irs/netdb.h.in b/bind/bind/lib/irs/include/irs/netdb.h.in
|
||||
index 23dcd37..f36113d 100644
|
||||
--- a/bind/bind/lib/irs/include/irs/netdb.h.in
|
||||
+++ b/bind/bind/lib/irs/include/irs/netdb.h.in
|
||||
@@ -149,6 +149,100 @@ struct addrinfo {
|
||||
#define NI_NUMERICSERV 0x00000008
|
||||
#define NI_DGRAM 0x00000010
|
||||
|
||||
+/*
|
||||
+ * Define to map into irs_ namespace.
|
||||
+ */
|
||||
+
|
||||
+#define IRS_NAMESPACE
|
||||
+
|
||||
+#ifdef IRS_NAMESPACE
|
||||
+
|
||||
+/*
|
||||
+ * Use our versions not the ones from the C library.
|
||||
+ */
|
||||
+
|
||||
+#ifdef getnameinfo
|
||||
+#undef getnameinfo
|
||||
+#endif
|
||||
+#define getnameinfo irs_getnameinfo
|
||||
+
|
||||
+#ifdef getaddrinfo
|
||||
+#undef getaddrinfo
|
||||
+#endif
|
||||
+#define getaddrinfo irs_getaddrinfo
|
||||
+
|
||||
+#ifdef freeaddrinfo
|
||||
+#undef freeaddrinfo
|
||||
+#endif
|
||||
+#define freeaddrinfo irs_freeaddrinfo
|
||||
+
|
||||
+#ifdef gai_strerror
|
||||
+#undef gai_strerror
|
||||
+#endif
|
||||
+#define gai_strerror irs_gai_strerror
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+extern int getaddrinfo (const char *name,
|
||||
+ const char *service,
|
||||
+ const struct addrinfo *req,
|
||||
+ struct addrinfo **pai);
|
||||
+extern int getnameinfo (const struct sockaddr *sa,
|
||||
+ socklen_t salen, char *host,
|
||||
+ socklen_t hostlen, char *serv,
|
||||
+ socklen_t servlen, int flags);
|
||||
+extern void freeaddrinfo (struct addrinfo *ai);
|
||||
+extern const char *gai_strerror (int ecode);
|
||||
+
|
||||
+/*
|
||||
+ * Define to map into irs_ namespace.
|
||||
+ */
|
||||
+
|
||||
+#define IRS_NAMESPACE
|
||||
+
|
||||
+#ifdef IRS_NAMESPACE
|
||||
+
|
||||
+/*
|
||||
+ * Use our versions not the ones from the C library.
|
||||
+ */
|
||||
+
|
||||
+#ifdef getnameinfo
|
||||
+#undef getnameinfo
|
||||
+#endif
|
||||
+#define getnameinfo irs_getnameinfo
|
||||
+
|
||||
+#ifdef getaddrinfo
|
||||
+#undef getaddrinfo
|
||||
+#endif
|
||||
+#define getaddrinfo irs_getaddrinfo
|
||||
+
|
||||
+#ifdef freeaddrinfo
|
||||
+#undef freeaddrinfo
|
||||
+#endif
|
||||
+#define freeaddrinfo irs_freeaddrinfo
|
||||
+
|
||||
+#ifdef gai_strerror
|
||||
+#undef gai_strerror
|
||||
+#endif
|
||||
+#define gai_strerror irs_gai_strerror
|
||||
+
|
||||
+int
|
||||
+getaddrinfo(const char *hostname, const char *servname,
|
||||
+ const struct addrinfo *hints, struct addrinfo **res);
|
||||
+
|
||||
+int
|
||||
+getnameinfo(const struct sockaddr *sa, IRS_GETNAMEINFO_SOCKLEN_T salen,
|
||||
+ char *host, IRS_GETNAMEINFO_BUFLEN_T hostlen,
|
||||
+ char *serv, IRS_GETNAMEINFO_BUFLEN_T servlen,
|
||||
+ IRS_GETNAMEINFO_FLAGS_T flags);
|
||||
+
|
||||
+void freeaddrinfo (struct addrinfo *ai);
|
||||
+
|
||||
+IRS_GAISTRERROR_RETURN_T
|
||||
+gai_strerror(int ecode);
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* Tell Emacs to use C mode on this file.
|
||||
* Local variables:
|
||||
--
|
||||
2.26.3
|
||||
|
@ -1,200 +0,0 @@
|
||||
diff --git a/bind/bind-9.11.14/lib/dns/resolver.c b/bind/bind-9.11.14/lib/dns/resolver.c
|
||||
index e24499e..969bb9e 100644
|
||||
--- a/bind/bind-9.11.14/lib/dns/resolver.c
|
||||
+++ b/bind/bind-9.11.14/lib/dns/resolver.c
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <dns/stats.h>
|
||||
#include <dns/tsig.h>
|
||||
#include <dns/validator.h>
|
||||
+#include <dns/zone.h>
|
||||
|
||||
#ifdef WANT_QUERYTRACE
|
||||
#define RTRACE(m) isc_log_write(dns_lctx, \
|
||||
@@ -303,6 +304,8 @@ struct fetchctx {
|
||||
bool ns_ttl_ok;
|
||||
uint32_t ns_ttl;
|
||||
isc_counter_t * qc;
|
||||
+ dns_fixedname_t fwdfname;
|
||||
+ dns_name_t *fwdname;
|
||||
|
||||
/*%
|
||||
* The number of events we're waiting for.
|
||||
@@ -3344,6 +3347,7 @@ fctx_getaddresses(fetchctx_t *fctx, bool badcache) {
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
fwd = ISC_LIST_HEAD(forwarders->fwdrs);
|
||||
fctx->fwdpolicy = forwarders->fwdpolicy;
|
||||
+ dns_name_copy(domain, fctx->fwdname, NULL);
|
||||
if (fctx->fwdpolicy == dns_fwdpolicy_only &&
|
||||
isstrictsubdomain(domain, &fctx->domain)) {
|
||||
fcount_decr(fctx);
|
||||
@@ -4368,6 +4372,9 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
|
||||
fctx->restarts = 0;
|
||||
fctx->querysent = 0;
|
||||
fctx->referrals = 0;
|
||||
+
|
||||
+ fctx->fwdname = dns_fixedname_initname(&fctx->fwdfname);
|
||||
+
|
||||
TIME_NOW(&fctx->start);
|
||||
fctx->timeouts = 0;
|
||||
fctx->lamecount = 0;
|
||||
@@ -4421,8 +4428,10 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
|
||||
domain = dns_fixedname_initname(&fixed);
|
||||
result = dns_fwdtable_find2(fctx->res->view->fwdtable, fwdname,
|
||||
domain, &forwarders);
|
||||
- if (result == ISC_R_SUCCESS)
|
||||
+ if (result == ISC_R_SUCCESS) {
|
||||
fctx->fwdpolicy = forwarders->fwdpolicy;
|
||||
+ dns_name_copy(domain, fctx->fwdname, NULL);
|
||||
+ }
|
||||
|
||||
if (fctx->fwdpolicy != dns_fwdpolicy_only) {
|
||||
/*
|
||||
@@ -6175,6 +6184,112 @@ mark_related(dns_name_t *name, dns_rdataset_t *rdataset,
|
||||
rdataset->attributes |= DNS_RDATASETATTR_EXTERNAL;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Returns true if 'name' is external to the namespace for which
|
||||
+ * the server being queried can answer, either because it's not a
|
||||
+ * subdomain or because it's below a forward declaration or a
|
||||
+ * locally served zone.
|
||||
+ */
|
||||
+static inline bool
|
||||
+name_external(dns_name_t *name, dns_rdatatype_t type, fetchctx_t *fctx) {
|
||||
+ isc_result_t result;
|
||||
+ dns_forwarders_t *forwarders = NULL;
|
||||
+ dns_fixedname_t fixed, zfixed;
|
||||
+ dns_name_t *fname = dns_fixedname_initname(&fixed);
|
||||
+ dns_name_t *zfname = dns_fixedname_initname(&zfixed);
|
||||
+ dns_name_t *apex = NULL;
|
||||
+ dns_name_t suffix;
|
||||
+ dns_zone_t *zone = NULL;
|
||||
+ unsigned int labels;
|
||||
+ dns_namereln_t rel;
|
||||
+ /*
|
||||
+ * The following two variables do not influence code flow; they are
|
||||
+ * only necessary for calling dns_name_fullcompare().
|
||||
+ */
|
||||
+ int _orderp = 0;
|
||||
+ unsigned int _nlabelsp = 0;
|
||||
+
|
||||
+ apex = ISFORWARDER(fctx->addrinfo) ? fctx->fwdname : &fctx->domain;
|
||||
+
|
||||
+ /*
|
||||
+ * The name is outside the queried namespace.
|
||||
+ */
|
||||
+ rel = dns_name_fullcompare(name, apex, &_orderp, &_nlabelsp);
|
||||
+ if (rel != dns_namereln_subdomain && rel != dns_namereln_equal) {
|
||||
+ return (true);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * If the record lives in the parent zone, adjust the name so we
|
||||
+ * look for the correct zone or forward clause.
|
||||
+ */
|
||||
+ labels = dns_name_countlabels(name);
|
||||
+ if (dns_rdatatype_atparent(type) && labels > 1U) {
|
||||
+ dns_name_init(&suffix, NULL);
|
||||
+ dns_name_getlabelsequence(name, 1, labels - 1, &suffix);
|
||||
+ name = &suffix;
|
||||
+ } else if (rel == dns_namereln_equal) {
|
||||
+ /* If 'name' is 'apex', no further checking is needed. */
|
||||
+ return (false);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * If there is a locally served zone between 'apex' and 'name'
|
||||
+ * then don't cache.
|
||||
+ */
|
||||
+ LOCK(&fctx->res->view->lock);
|
||||
+ if (fctx->res->view->zonetable != NULL) {
|
||||
+ unsigned int options = DNS_ZTFIND_NOEXACT;
|
||||
+ result = dns_zt_find(fctx->res->view->zonetable, name, options,
|
||||
+ zfname, &zone);
|
||||
+ if (zone != NULL) {
|
||||
+ dns_zone_detach(&zone);
|
||||
+ }
|
||||
+ if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) {
|
||||
+ if (dns_name_fullcompare(zfname, apex, &_orderp,
|
||||
+ &_nlabelsp) ==
|
||||
+ dns_namereln_subdomain)
|
||||
+ {
|
||||
+ UNLOCK(&fctx->res->view->lock);
|
||||
+ return (true);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ UNLOCK(&fctx->res->view->lock);
|
||||
+
|
||||
+ /*
|
||||
+ * Look for a forward declaration below 'name'.
|
||||
+ */
|
||||
+ result = dns_fwdtable_find2(fctx->res->view->fwdtable, name, fname,
|
||||
+ &forwarders);
|
||||
+
|
||||
+ if (ISFORWARDER(fctx->addrinfo)) {
|
||||
+ /*
|
||||
+ * See if the forwarder declaration is better.
|
||||
+ */
|
||||
+ if (result == ISC_R_SUCCESS) {
|
||||
+ return (!dns_name_equal(fname, fctx->fwdname));
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * If the lookup failed, the configuration must have
|
||||
+ * changed: play it safe and don't cache.
|
||||
+ */
|
||||
+ return (true);
|
||||
+ } else if (result == ISC_R_SUCCESS &&
|
||||
+ forwarders->fwdpolicy == dns_fwdpolicy_only &&
|
||||
+ !ISC_LIST_EMPTY(forwarders->fwdrs))
|
||||
+ {
|
||||
+ /*
|
||||
+ * If 'name' is covered by a 'forward only' clause then we
|
||||
+ * can't cache this repsonse.
|
||||
+ */
|
||||
+ return (true);
|
||||
+ }
|
||||
+
|
||||
+ return (false);
|
||||
+}
|
||||
+
|
||||
static isc_result_t
|
||||
check_section(void *arg, dns_name_t *addname, dns_rdatatype_t type,
|
||||
dns_section_t section)
|
||||
@@ -6201,7 +6316,7 @@ check_section(void *arg, dns_name_t *addname, dns_rdatatype_t type,
|
||||
result = dns_message_findname(fctx->rmessage, section, addname,
|
||||
dns_rdatatype_any, 0, &name, NULL);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
- external = !dns_name_issubdomain(name, &fctx->domain);
|
||||
+ external = name_external(name, type, fctx);
|
||||
if (type == dns_rdatatype_a) {
|
||||
for (rdataset = ISC_LIST_HEAD(name->list);
|
||||
rdataset != NULL;
|
||||
@@ -7071,6 +7186,13 @@ answer_response(fetchctx_t *fctx) {
|
||||
break;
|
||||
|
||||
case dns_namereln_subdomain:
|
||||
+ /*
|
||||
+ * Don't accept DNAME from parent namespace.
|
||||
+ */
|
||||
+ if (name_external(name, dns_rdatatype_dname, fctx)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* In-scope DNAME records must have at least
|
||||
* as many labels as the domain being queried.
|
||||
@@ -7299,11 +7421,9 @@ answer_response(fetchctx_t *fctx) {
|
||||
*/
|
||||
result = dns_message_firstname(message, DNS_SECTION_AUTHORITY);
|
||||
while (!done && result == ISC_R_SUCCESS) {
|
||||
- bool external;
|
||||
name = NULL;
|
||||
dns_message_currentname(message, DNS_SECTION_AUTHORITY, &name);
|
||||
- external = !dns_name_issubdomain(name, &fctx->domain);
|
||||
- if (!external) {
|
||||
+ if (!name_external(name, dns_rdatatype_ns, fctx)) {
|
||||
/*
|
||||
* We expect to find NS or SIG NS rdatasets, and
|
||||
* nothing else.
|
@ -0,0 +1,31 @@
|
||||
diff -up dhcp-4.2.5/client/dhclient.c.orig dhcp-4.2.5/client/dhclient.c
|
||||
--- dhcp-4.2.5/client/dhclient.c.orig 2018-11-07 14:21:16.756152614 +0100
|
||||
+++ dhcp-4.2.5/client/dhclient.c 2018-11-08 17:30:15.754440523 +0100
|
||||
@@ -1618,8 +1618,14 @@ void dhcpack (packet)
|
||||
} else
|
||||
client -> new -> renewal = 0;
|
||||
|
||||
- /* If it wasn't specified by the server, calculate it. */
|
||||
- if (!client -> new -> renewal)
|
||||
+ /*
|
||||
+ * If it wasn't specified by the server, calculate it. Also use expiry
|
||||
+ * instead of renewal time when it is shorter. This better follows
|
||||
+ * RFC 2131 (section 4.4.5) when dealing with some DHCP servers.
|
||||
+ */
|
||||
+
|
||||
+ if (!client -> new -> renewal ||
|
||||
+ client -> new -> renewal > client -> new -> expiry)
|
||||
client -> new -> renewal = client -> new -> expiry / 2 + 1;
|
||||
|
||||
if (client -> new -> renewal <= 0)
|
||||
@@ -1645,7 +1651,9 @@ void dhcpack (packet)
|
||||
} else
|
||||
client -> new -> rebind = 0;
|
||||
|
||||
- if (client -> new -> rebind <= 0) {
|
||||
+ /* Rebinding time must not be longer than expiry. */
|
||||
+ if (client -> new -> rebind <= 0 ||
|
||||
+ client -> new -> rebind > client -> new -> expiry) {
|
||||
if (client -> new -> expiry <= TIME_MAX / 7)
|
||||
client -> new -> rebind =
|
||||
client -> new -> expiry * 7 / 8;
|
@ -0,0 +1,77 @@
|
||||
From c37721f799e6b32da156759a830011949311205a Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Fri, 16 Feb 2018 17:50:40 +0100
|
||||
Subject: [PATCH] New bind includes never includes isc/util.h from any public
|
||||
headers. Include them to all compiled files that require it.
|
||||
|
||||
---
|
||||
client/dhclient.c | 1 +
|
||||
common/execute.c | 1 +
|
||||
common/parse.c | 1 +
|
||||
common/socket.c | 1 +
|
||||
omapip/connection.c | 1 +
|
||||
5 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||
index 228b4fe..014365d 100644
|
||||
--- a/client/dhclient.c
|
||||
+++ b/client/dhclient.c
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <limits.h>
|
||||
#include <isc/file.h>
|
||||
+#include <isc/util.h>
|
||||
#include <dns/result.h>
|
||||
|
||||
#ifdef HAVE_LIBCAP_NG
|
||||
diff --git a/common/execute.c b/common/execute.c
|
||||
index fa4e0f8..1ee1e7d 100644
|
||||
--- a/common/execute.c
|
||||
+++ b/common/execute.c
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "dhcpd.h"
|
||||
#include <omapip/omapip_p.h>
|
||||
+#include <isc/util.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
diff --git a/common/parse.c b/common/parse.c
|
||||
index d08cd2c..729d442 100644
|
||||
--- a/common/parse.c
|
||||
+++ b/common/parse.c
|
||||
@@ -27,6 +27,7 @@
|
||||
*/
|
||||
|
||||
#include "dhcpd.h"
|
||||
+#include <isc/util.h>
|
||||
#include <syslog.h>
|
||||
|
||||
/* Enumerations can be specified in option formats, and are used for
|
||||
diff --git a/common/socket.c b/common/socket.c
|
||||
index 2b352a1..94ce334 100644
|
||||
--- a/common/socket.c
|
||||
+++ b/common/socket.c
|
||||
@@ -35,6 +35,7 @@
|
||||
*/
|
||||
|
||||
#include "dhcpd.h"
|
||||
+#include <isc/util.h>
|
||||
#include <errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/uio.h>
|
||||
diff --git a/omapip/connection.c b/omapip/connection.c
|
||||
index 9aac0c8..a74becc 100644
|
||||
--- a/omapip/connection.c
|
||||
+++ b/omapip/connection.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "dhcpd.h"
|
||||
|
||||
#include <omapip/omapip_p.h>
|
||||
+#include <isc/util.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <errno.h>
|
||||
--
|
||||
2.14.3
|
||||
|
@ -0,0 +1,52 @@
|
||||
commit ccff9ed69d0b26d33ce9cac8e83dab535b64d627
|
||||
Author: Thomas Markwalder <tmark@isc.org>
|
||||
Date: Tue Dec 5 15:12:34 2017 -0500
|
||||
|
||||
[46767] Plugged a socket descriptor leak in OMAPI
|
||||
|
||||
If disconnect is triggered by the reader closing the socket, while there
|
||||
is data left to write, the socket would be orphaned.
|
||||
|
||||
omapip/buffer.c
|
||||
omapi_connection_writea() - added logic to recall disconnect once
|
||||
pending data has been written
|
||||
|
||||
omapip/message.c
|
||||
Removed static declaration from omapi_message_unregister so you can
|
||||
actually compile when DEBUG_PROTOCOL is defined.
|
||||
|
||||
Added a release note
|
||||
|
||||
diff --git a/omapip/buffer.c b/omapip/buffer.c
|
||||
index 6e0621b..a21f0a8 100644
|
||||
--- a/omapip/buffer.c
|
||||
+++ b/omapip/buffer.c
|
||||
@@ -565,6 +565,15 @@ isc_result_t omapi_connection_writer (omapi_object_t *h)
|
||||
omapi_buffer_dereference (&buffer, MDL);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /* If we had data left to write when we're told to disconnect,
|
||||
+ * we need recall disconnect, now that we're done writing.
|
||||
+ * See rt46767. */
|
||||
+ if (c->out_bytes == 0 && c->state == omapi_connection_disconnecting) {
|
||||
+ omapi_disconnect (h, 1);
|
||||
+ return ISC_R_SHUTTINGDOWN;
|
||||
+ }
|
||||
+
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
diff --git a/omapip/message.c b/omapip/message.c
|
||||
index ee15d82..37abbd2 100644
|
||||
--- a/omapip/message.c
|
||||
+++ b/omapip/message.c
|
||||
@@ -339,7 +339,7 @@ isc_result_t omapi_message_unregister (omapi_object_t *mo)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PROTOCOL
|
||||
-static const char *omapi_message_op_name(int op) {
|
||||
+const char *omapi_message_op_name(int op) {
|
||||
switch (op) {
|
||||
case OMAPI_OP_OPEN: return "OMAPI_OP_OPEN";
|
||||
case OMAPI_OP_REFRESH: return "OMAPI_OP_REFRESH";
|
@ -0,0 +1,41 @@
|
||||
diff --git a/common/options.c b/common/options.c
|
||||
index 83e0384..8a1deca 100644
|
||||
--- a/common/options.c
|
||||
+++ b/common/options.c
|
||||
@@ -1672,7 +1672,8 @@ format_min_length(format, oc)
|
||||
|
||||
|
||||
/* Format the specified option so that a human can easily read it. */
|
||||
-
|
||||
+/* Maximum pretty printed size */
|
||||
+#define MAX_OUTPUT_SIZE 32*1024
|
||||
const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
|
||||
struct option *option;
|
||||
const unsigned char *data;
|
||||
@@ -1680,8 +1681,9 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
|
||||
int emit_commas;
|
||||
int emit_quotes;
|
||||
{
|
||||
- static char optbuf [32768]; /* XXX */
|
||||
- static char *endbuf = &optbuf[sizeof(optbuf)];
|
||||
+ /* We add 128 byte pad so we don't have to add checks everywhere. */
|
||||
+ static char optbuf [MAX_OUTPUT_SIZE + 128]; /* XXX */
|
||||
+ static char *endbuf = optbuf + MAX_OUTPUT_SIZE;
|
||||
int hunksize = 0;
|
||||
int opthunk = 0;
|
||||
int hunkinc = 0;
|
||||
@@ -2132,7 +2134,14 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
|
||||
log_error ("Unexpected format code %c",
|
||||
fmtbuf [j]);
|
||||
}
|
||||
+
|
||||
op += strlen (op);
|
||||
+ if (op >= endbuf) {
|
||||
+ log_error ("Option data exceeds"
|
||||
+ " maximum size %d", MAX_OUTPUT_SIZE);
|
||||
+ return ("<error>");
|
||||
+ }
|
||||
+
|
||||
if (dp == data + len)
|
||||
break;
|
||||
if (j + 1 < numelem && comma != ':')
|
@ -0,0 +1,13 @@
|
||||
diff --git a/common/options.c b/common/options.c
|
||||
index 83e0384..a58c5fc 100644
|
||||
--- a/common/options.c
|
||||
+++ b/common/options.c
|
||||
@@ -189,6 +189,8 @@ int parse_option_buffer (options, buffer, length, universe)
|
||||
|
||||
/* If the length is outrageous, the options are bad. */
|
||||
if (offset + len > length) {
|
||||
+ /* Avoid reference count overflow */
|
||||
+ option_dereference(&option, MDL);
|
||||
reason = "option length exceeds option buffer length";
|
||||
bogus:
|
||||
log_error("parse_option_buffer: malformed option "
|
@ -0,0 +1,75 @@
|
||||
diff -up dhcp-4.3.0a1/common/parse.c.64-bit_lease_parse dhcp-4.3.0a1/common/parse.c
|
||||
--- dhcp-4.3.0a1/common/parse.c.64-bit_lease_parse 2013-12-11 01:25:12.000000000 +0100
|
||||
+++ dhcp-4.3.0a1/common/parse.c 2013-12-19 15:45:25.990771814 +0100
|
||||
@@ -938,8 +938,8 @@ TIME
|
||||
parse_date_core(cfile)
|
||||
struct parse *cfile;
|
||||
{
|
||||
- int guess;
|
||||
- int tzoff, year, mon, mday, hour, min, sec;
|
||||
+ TIME guess;
|
||||
+ long int tzoff, year, mon, mday, hour, min, sec;
|
||||
const char *val;
|
||||
enum dhcp_token token;
|
||||
static int months[11] = { 31, 59, 90, 120, 151, 181,
|
||||
@@ -965,7 +965,7 @@ parse_date_core(cfile)
|
||||
}
|
||||
|
||||
skip_token(&val, NULL, cfile); /* consume number */
|
||||
- guess = atoi(val);
|
||||
+ guess = atol(val);
|
||||
|
||||
return((TIME)guess);
|
||||
}
|
||||
@@ -993,7 +993,7 @@ parse_date_core(cfile)
|
||||
somebody invents a time machine, I think we can safely disregard
|
||||
it. This actually works around a stupid Y2K bug that was present
|
||||
in a very early beta release of dhcpd. */
|
||||
- year = atoi(val);
|
||||
+ year = atol(val);
|
||||
if (year > 1900)
|
||||
year -= 1900;
|
||||
|
||||
@@ -1039,7 +1039,7 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
skip_token(&val, NULL, cfile); /* consume day of month */
|
||||
- mday = atoi(val);
|
||||
+ mday = atol(val);
|
||||
|
||||
/* Hour... */
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
@@ -1050,7 +1050,7 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
skip_token(&val, NULL, cfile); /* consume hour */
|
||||
- hour = atoi(val);
|
||||
+ hour = atol(val);
|
||||
|
||||
/* Colon separating hour from minute... */
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
@@ -1072,7 +1072,7 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
skip_token(&val, NULL, cfile); /* consume minute */
|
||||
- min = atoi(val);
|
||||
+ min = atol(val);
|
||||
|
||||
/* Colon separating minute from second... */
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
@@ -1094,13 +1094,13 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
skip_token(&val, NULL, cfile); /* consume second */
|
||||
- sec = atoi(val);
|
||||
+ sec = atol(val);
|
||||
|
||||
tzoff = 0;
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
if (token == NUMBER) {
|
||||
skip_token(&val, NULL, cfile); /* consume tzoff */
|
||||
- tzoff = atoi(val);
|
||||
+ tzoff = atol(val);
|
||||
} else if (token != SEMI) {
|
||||
skip_token(&val, NULL, cfile);
|
||||
parse_warn(cfile,
|
@ -1,8 +1,8 @@
|
||||
diff --git a/common/options.c b/common/options.c
|
||||
index 40238f7..11b1961 100644
|
||||
index addc65a..3e6383a 100644
|
||||
--- a/common/options.c
|
||||
+++ b/common/options.c
|
||||
@@ -454,16 +454,16 @@ int fqdn_universe_decode (struct option_state *options,
|
||||
@@ -435,16 +435,16 @@ int fqdn_universe_decode (struct option_state *options,
|
||||
while (s < &bp -> data[0] + length + 2) {
|
||||
len = *s;
|
||||
if (len > 63) {
|
@ -0,0 +1,164 @@
|
||||
--- a/server/dhcp.c 2017-07-14 15:32:14.611104590 +0200
|
||||
+++ b/server/dhcp.c 2017-07-14 15:34:17.508858018 +0200
|
||||
@@ -87,6 +87,42 @@
|
||||
|
||||
static TIME leaseTimeCheck(TIME calculated, TIME alternate);
|
||||
|
||||
+char *print_client_identifier_from_packet (packet)
|
||||
+ struct packet *packet;
|
||||
+{
|
||||
+ struct option_cache *oc;
|
||||
+ struct data_string client_identifier;
|
||||
+ char *ci;
|
||||
+
|
||||
+ memset (&client_identifier, 0, sizeof client_identifier);
|
||||
+
|
||||
+ oc = lookup_option (&dhcp_universe, packet -> options,
|
||||
+ DHO_DHCP_CLIENT_IDENTIFIER);
|
||||
+ if (oc &&
|
||||
+ evaluate_option_cache (&client_identifier,
|
||||
+ packet, (struct lease *)0,
|
||||
+ (struct client_state *)0,
|
||||
+ packet -> options,
|
||||
+ (struct option_state *)0,
|
||||
+ &global_scope, oc, MDL)) {
|
||||
+ ci = print_hw_addr (HTYPE_INFINIBAND, client_identifier.len, client_identifier.data);
|
||||
+ data_string_forget (&client_identifier, MDL);
|
||||
+ return ci;
|
||||
+ } else
|
||||
+ return "\"no client id\"";
|
||||
+}
|
||||
+
|
||||
+char *print_hw_addr_or_client_id (packet)
|
||||
+ struct packet *packet;
|
||||
+{
|
||||
+ if (packet -> raw -> htype == HTYPE_INFINIBAND)
|
||||
+ return print_client_identifier_from_packet (packet);
|
||||
+ else
|
||||
+ return print_hw_addr (packet -> raw -> htype,
|
||||
+ packet -> raw -> hlen,
|
||||
+ packet -> raw -> chaddr);
|
||||
+}
|
||||
+
|
||||
void
|
||||
dhcp (struct packet *packet) {
|
||||
int ms_nulltp = 0;
|
||||
@@ -129,9 +165,7 @@
|
||||
|
||||
log_info("%s from %s via %s: %s", s,
|
||||
(packet->raw->htype
|
||||
- ? print_hw_addr(packet->raw->htype,
|
||||
- packet->raw->hlen,
|
||||
- packet->raw->chaddr)
|
||||
+ ? print_hw_addr_or_client_id(packet)
|
||||
: "<no identifier>"),
|
||||
packet->raw->giaddr.s_addr
|
||||
? inet_ntoa(packet->raw->giaddr)
|
||||
@@ -328,9 +362,7 @@
|
||||
#endif
|
||||
snprintf (msgbuf, sizeof msgbuf, "DHCPDISCOVER from %s %s%s%svia %s",
|
||||
(packet -> raw -> htype
|
||||
- ? print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)
|
||||
+ ? print_hw_addr_or_client_id (packet)
|
||||
: (lease
|
||||
? print_hex_1(lease->uid_len, lease->uid, 60)
|
||||
: "<no identifier>")),
|
||||
@@ -542,9 +574,7 @@
|
||||
"DHCPREQUEST for %s%s from %s %s%s%svia %s",
|
||||
piaddr (cip), smbuf,
|
||||
(packet -> raw -> htype
|
||||
- ? print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)
|
||||
+ ? print_hw_addr_or_client_id(packet)
|
||||
: (lease
|
||||
? print_hex_1(lease->uid_len, lease->uid, 60)
|
||||
: "<no identifier>")),
|
||||
@@ -785,9 +815,7 @@
|
||||
if ((oc = lookup_option (&dhcp_universe, packet -> options,
|
||||
DHO_DHCP_REQUESTED_ADDRESS))) {
|
||||
log_info ("DHCPRELEASE from %s specified requested-address.",
|
||||
- print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr));
|
||||
+ print_hw_addr_or_client_id(packet));
|
||||
}
|
||||
|
||||
oc = lookup_option (&dhcp_universe, packet -> options,
|
||||
@@ -879,9 +907,7 @@
|
||||
"DHCPRELEASE of %s from %s %s%s%svia %s (%sfound)",
|
||||
cstr,
|
||||
(packet -> raw -> htype
|
||||
- ? print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)
|
||||
+ ? print_hw_addr_or_client_id(packet)
|
||||
: (lease
|
||||
? print_hex_1(lease->uid_len, lease->uid, 60)
|
||||
: "<no identifier>")),
|
||||
@@ -986,9 +1012,7 @@
|
||||
"DHCPDECLINE of %s from %s %s%s%svia %s",
|
||||
piaddr (cip),
|
||||
(packet -> raw -> htype
|
||||
- ? print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)
|
||||
+ ? print_hw_addr_or_client_id(packet)
|
||||
: (lease
|
||||
? print_hex_1(lease->uid_len, lease->uid, 60)
|
||||
: "<no identifier>")),
|
||||
@@ -1707,8 +1731,7 @@
|
||||
/* Report what we're sending. */
|
||||
snprintf(msgbuf, sizeof msgbuf, "DHCPACK to %s (%s) via", piaddr(cip),
|
||||
(packet->raw->htype && packet->raw->hlen) ?
|
||||
- print_hw_addr(packet->raw->htype, packet->raw->hlen,
|
||||
- packet->raw->chaddr) :
|
||||
+ print_hw_addr_or_client_id(packet) :
|
||||
"<no client hardware address>");
|
||||
log_info("%s %s", msgbuf, gip.len ? piaddr(gip) :
|
||||
packet->interface->name);
|
||||
@@ -1886,9 +1909,7 @@
|
||||
#endif
|
||||
log_info ("DHCPNAK on %s to %s via %s",
|
||||
piaddr (*cip),
|
||||
- print_hw_addr (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr),
|
||||
+ print_hw_addr_or_client_id(packet),
|
||||
packet -> raw -> giaddr.s_addr
|
||||
? inet_ntoa (packet -> raw -> giaddr)
|
||||
: packet -> interface -> name);
|
||||
@@ -3897,7 +3918,7 @@
|
||||
? (state -> offer == DHCPACK ? "DHCPACK" : "DHCPOFFER")
|
||||
: "BOOTREPLY"),
|
||||
piaddr (lease -> ip_addr),
|
||||
- (lease -> hardware_addr.hlen
|
||||
+ (lease -> hardware_addr.hlen > 1
|
||||
? print_hw_addr (lease -> hardware_addr.hbuf [0],
|
||||
lease -> hardware_addr.hlen - 1,
|
||||
&lease -> hardware_addr.hbuf [1])
|
||||
@@ -4450,10 +4471,7 @@
|
||||
if (uid_lease) {
|
||||
if (uid_lease->binding_state == FTS_ACTIVE) {
|
||||
log_error ("client %s has duplicate%s on %s",
|
||||
- (print_hw_addr
|
||||
- (packet -> raw -> htype,
|
||||
- packet -> raw -> hlen,
|
||||
- packet -> raw -> chaddr)),
|
||||
+ (print_hw_addr_or_client_id(packet)),
|
||||
" leases",
|
||||
(ip_lease -> subnet ->
|
||||
shared_network -> name));
|
||||
@@ -4620,9 +4638,7 @@
|
||||
log_error("uid lease %s for client %s is duplicate "
|
||||
"on %s",
|
||||
piaddr(uid_lease->ip_addr),
|
||||
- print_hw_addr(packet->raw->htype,
|
||||
- packet->raw->hlen,
|
||||
- packet->raw->chaddr),
|
||||
+ print_hw_addr_or_client_id(packet),
|
||||
uid_lease->subnet->shared_network->name);
|
||||
|
||||
if (!packet -> raw -> ciaddr.s_addr &&
|
@ -0,0 +1,14 @@
|
||||
diff -up dhcp-4.3.0a1/common/dispatch.c.dracut dhcp-4.3.0a1/common/dispatch.c
|
||||
--- dhcp-4.3.0a1/common/dispatch.c.dracut 2013-12-11 01:25:12.000000000 +0100
|
||||
+++ dhcp-4.3.0a1/common/dispatch.c 2013-12-19 15:39:50.350505860 +0100
|
||||
@@ -210,6 +210,10 @@ void add_timeout (when, where, what, ref
|
||||
isc_interval_t interval;
|
||||
isc_time_t expires;
|
||||
|
||||
+ if (when == NULL) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* See if this timeout supersedes an existing timeout. */
|
||||
t = (struct timeout *)0;
|
||||
for (q = timeouts; q; q = q->next) {
|
@ -0,0 +1,85 @@
|
||||
From ffb24c0bbd4d6f2b4718a1a8f4f2da237cc6ed66 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Markwalder <tmark@isc.org>
|
||||
Date: Fri, 14 Sep 2018 13:41:41 -0400
|
||||
Subject: [PATCH] [master] Added includes of new BIND9 compatibility headers,
|
||||
updated util/bind.sh
|
||||
|
||||
Merges in rt48072.
|
||||
|
||||
(cherry picked from commit 8194daabfd590f17825f0c61e9534bee5c99cc86)
|
||||
---
|
||||
includes/omapip/isclib.h | 3 +++
|
||||
includes/omapip/result.h | 1 +
|
||||
server/dhcpv6.c | 13 +++++++++----
|
||||
3 files changed, 13 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/includes/omapip/isclib.h b/includes/omapip/isclib.h
|
||||
index e2963089..fa5d9ad3 100644
|
||||
--- a/includes/omapip/isclib.h
|
||||
+++ b/includes/omapip/isclib.h
|
||||
@@ -48,6 +48,9 @@
|
||||
#include <string.h>
|
||||
#include <netdb.h>
|
||||
|
||||
+#include <isc/boolean.h>
|
||||
+#include <isc/int.h>
|
||||
+
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/lex.h>
|
||||
#include <isc/lib.h>
|
||||
diff --git a/includes/omapip/result.h b/includes/omapip/result.h
|
||||
index ae5f7d6a..9c1fab23 100644
|
||||
--- a/includes/omapip/result.h
|
||||
+++ b/includes/omapip/result.h
|
||||
@@ -26,6 +26,7 @@
|
||||
#ifndef DHCP_RESULT_H
|
||||
#define DHCP_RESULT_H 1
|
||||
|
||||
+#include <isc/boolean.h>
|
||||
#include <isc/lang.h>
|
||||
#include <isc/resultclass.h>
|
||||
#include <isc/types.h>
|
||||
diff --git a/server/dhcpv6.c b/server/dhcpv6.c
|
||||
index 74487667..1a6ff241 100644
|
||||
--- a/server/dhcpv6.c
|
||||
+++ b/server/dhcpv6.c
|
||||
@@ -1003,7 +1003,8 @@ void check_pool6_threshold(struct reply_state *reply,
|
||||
shared_name,
|
||||
inet_ntop(AF_INET6, &lease->addr,
|
||||
tmp_addr, sizeof(tmp_addr)),
|
||||
- used, count);
|
||||
+ (long long unsigned)(used),
|
||||
+ (long long unsigned)(count));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1035,7 +1036,8 @@ void check_pool6_threshold(struct reply_state *reply,
|
||||
"address: %s; high threshold %d%% %llu/%llu.",
|
||||
shared_name,
|
||||
inet_ntop(AF_INET6, &lease->addr, tmp_addr, sizeof(tmp_addr)),
|
||||
- poolhigh, used, count);
|
||||
+ poolhigh, (long long unsigned)(used),
|
||||
+ (long long unsigned)(count));
|
||||
|
||||
/* handle the low threshold now, if we don't
|
||||
* have one we default to 0. */
|
||||
@@ -1383,12 +1385,15 @@ pick_v6_address(struct reply_state *reply)
|
||||
log_debug("Unable to pick client address: "
|
||||
"no addresses available - shared network %s: "
|
||||
" 2^64-1 < total, %llu active, %llu abandoned",
|
||||
- shared_name, active - abandoned, abandoned);
|
||||
+ shared_name, (long long unsigned)(active - abandoned),
|
||||
+ (long long unsigned)(abandoned));
|
||||
} else {
|
||||
log_debug("Unable to pick client address: "
|
||||
"no addresses available - shared network %s: "
|
||||
"%llu total, %llu active, %llu abandoned",
|
||||
- shared_name, total, active - abandoned, abandoned);
|
||||
+ shared_name, (long long unsigned)(total),
|
||||
+ (long long unsigned)(active - abandoned),
|
||||
+ (long long unsigned)(abandoned));
|
||||
}
|
||||
|
||||
return ISC_R_NORESOURCES;
|
||||
--
|
||||
2.14.5
|
@ -0,0 +1,63 @@
|
||||
diff -up dhcp-4.3.4/client/dhclient.c.backoff dhcp-4.3.4/client/dhclient.c
|
||||
--- dhcp-4.3.4/client/dhclient.c.backoff 2016-04-29 12:16:26.976245611 +0200
|
||||
+++ dhcp-4.3.4/client/dhclient.c 2016-04-29 12:16:26.979245609 +0200
|
||||
@@ -1423,6 +1423,8 @@ void state_init (cpp)
|
||||
void *cpp;
|
||||
{
|
||||
struct client_state *client = cpp;
|
||||
+ enum dhcp_state init_state = client->state;
|
||||
+ struct timeval tv;
|
||||
|
||||
ASSERT_STATE(state, S_INIT);
|
||||
|
||||
@@ -1435,9 +1437,18 @@ void state_init (cpp)
|
||||
client -> first_sending = cur_time;
|
||||
client -> interval = client -> config -> initial_interval;
|
||||
|
||||
- /* Add an immediate timeout to cause the first DHCPDISCOVER packet
|
||||
- to go out. */
|
||||
- send_discover (client);
|
||||
+ if (init_state != S_DECLINED) {
|
||||
+ /* Add an immediate timeout to cause the first DHCPDISCOVER packet
|
||||
+ to go out. */
|
||||
+ send_discover(client);
|
||||
+ } else {
|
||||
+ /* We've received an OFFER and it has been DECLINEd by dhclient-script.
|
||||
+ * wait for a random time between 1 and backoff_cutoff seconds before
|
||||
+ * trying again. */
|
||||
+ tv . tv_sec = cur_time + ((1 + (random() >> 2)) % client->config->backoff_cutoff);
|
||||
+ tv . tv_usec = 0;
|
||||
+ add_timeout(&tv, send_discover, client, 0, 0);
|
||||
+ }
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1734,5 +1745,6 @@ void bind_lease (client)
|
||||
#endif
|
||||
exit(2);
|
||||
} else {
|
||||
+ client -> state = S_DECLINED;
|
||||
state_init(client);
|
||||
return;
|
||||
}
|
||||
@@ -4626,6 +4638,7 @@ void client_location_changed ()
|
||||
case S_INIT:
|
||||
case S_REBINDING:
|
||||
case S_STOPPED:
|
||||
+ case S_DECLINED:
|
||||
break;
|
||||
}
|
||||
client -> state = S_INIT;
|
||||
diff -up dhcp-4.3.4/includes/dhcpd.h.backoff dhcp-4.3.4/includes/dhcpd.h
|
||||
--- dhcp-4.3.4/includes/dhcpd.h.backoff 2016-04-29 12:16:26.980245609 +0200
|
||||
+++ dhcp-4.3.4/includes/dhcpd.h 2016-04-29 12:17:30.893203533 +0200
|
||||
@@ -1171,7 +1171,8 @@ enum dhcp_state {
|
||||
S_BOUND = 5,
|
||||
S_RENEWING = 6,
|
||||
S_REBINDING = 7,
|
||||
- S_STOPPED = 8
|
||||
+ S_STOPPED = 8,
|
||||
+ S_DECLINED = 9
|
||||
};
|
||||
|
||||
/* Possible pending client operations. */
|
@ -0,0 +1,94 @@
|
||||
diff --git a/client/dhc6.c b/client/dhc6.c
|
||||
index 5460ee1..fe0057c 100644
|
||||
--- a/client/dhc6.c
|
||||
+++ b/client/dhc6.c
|
||||
@@ -148,6 +148,7 @@ static int dhc6_score_lease(struct client_state *client,
|
||||
|
||||
extern int onetry;
|
||||
extern int stateless;
|
||||
+extern int address_prefix_len;
|
||||
|
||||
/*
|
||||
* Assign DHCPv6 port numbers as a client.
|
||||
@@ -4364,7 +4365,7 @@ dhc6_marshall_values(const char *prefix, struct client_state *client,
|
||||
(unsigned) addr->plen);
|
||||
} else {
|
||||
client_envadd(client, prefix, "ip6_prefixlen",
|
||||
- "%d", DHCLIENT_DEFAULT_PREFIX_LEN);
|
||||
+ "%d", address_prefix_len);
|
||||
client_envadd(client, prefix, "ip6_address",
|
||||
"%s", piaddr(addr->address));
|
||||
}
|
||||
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||
index b61da43..05bfc7e 100644
|
||||
--- a/client/dhclient.c
|
||||
+++ b/client/dhclient.c
|
||||
@@ -114,6 +114,7 @@ char *progname = NULL;
|
||||
|
||||
int bootp_broadcast_always = 0;
|
||||
|
||||
+int address_prefix_len = DHCLIENT_DEFAULT_PREFIX_LEN;
|
||||
extern struct option *default_requested_options[];
|
||||
|
||||
void run_stateless(int exit_mode, u_int16_t port);
|
||||
@@ -192,6 +193,7 @@ usage(const char *sfmt, const char *sarg)
|
||||
#endif
|
||||
#else /* DHCPv6 */
|
||||
"[-I1dvrxi] [-nw] [-p <port>] [-D LL|LLT] \n"
|
||||
+ " [--address-prefix-len length]\n"
|
||||
#endif /* DHCPv6 */
|
||||
" [-s server-addr] [-cf config-file]\n"
|
||||
" [-df duid-file] [-lf lease-file]\n"
|
||||
@@ -392,6 +394,17 @@ main(int argc, char **argv) {
|
||||
tmp->next = client_env;
|
||||
client_env = tmp;
|
||||
client_env_count++;
|
||||
+ } else if (!strcmp(argv[i], "--address-prefix-len")) {
|
||||
+ if (++i == argc) {
|
||||
+ usage(use_noarg, argv[i-1]);
|
||||
+ }
|
||||
+ errno = 0;
|
||||
+ address_prefix_len = (int)strtol(argv[i], &s, 10);
|
||||
+ if (errno || (*s != '\0') ||
|
||||
+ (address_prefix_len < 0)) {
|
||||
+ usage("Invalid value for"
|
||||
+ " --address-prefix-len: %s", argv[i]);
|
||||
+ }
|
||||
#ifdef DHCPv6
|
||||
} else if (!strcmp(argv[i], "-S")) {
|
||||
if (local_family_set && (local_family == AF_INET)) {
|
||||
diff --git a/includes/site.h b/includes/site.h
|
||||
index b2f7fd7..aad9711 100644
|
||||
--- a/includes/site.h
|
||||
+++ b/includes/site.h
|
||||
@@ -286,7 +286,7 @@
|
||||
is a host address and doesn't include any on-link information.
|
||||
64 indicates that the first 64 bits are the subnet or on-link
|
||||
prefix. */
|
||||
-#define DHCLIENT_DEFAULT_PREFIX_LEN 64
|
||||
+#define DHCLIENT_DEFAULT_PREFIX_LEN 128
|
||||
|
||||
/* Enable the gentle shutdown signal handling. Currently this
|
||||
means that on SIGINT or SIGTERM a client will release its
|
||||
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||
index 2f29591..6c8b145 100644
|
||||
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||
index b0bf2bf..f7b1476 100644
|
||||
--- a/client/dhclient.c
|
||||
+++ b/client/dhclient.c
|
||||
@@ -193,7 +193,6 @@ usage(const char *sfmt, const char *sarg)
|
||||
#endif
|
||||
#else /* DHCPv6 */
|
||||
"[-I1dvrxi] [-nw] [-p <port>] [-D LL|LLT] \n"
|
||||
- " [--address-prefix-len length]\n"
|
||||
#endif /* DHCPv6 */
|
||||
" [-s server-addr] [-cf config-file]\n"
|
||||
" [-df duid-file] [-lf lease-file]\n"
|
||||
@@ -202,6 +201,7 @@ usage(const char *sfmt, const char *sarg)
|
||||
" [-C <dhcp-client-identifier>] [-B]\n"
|
||||
" [-H <host-name> | -F <fqdn.fqdn>] [--timeout <timeout>]\n"
|
||||
" [-V <vendor-class-identifier>]\n"
|
||||
+ " [--address-prefix-len length]\n"
|
||||
" [--request-options <request option list>]",
|
||||
isc_file_basename(progname));
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
diff --git a/common/options.c b/common/options.c
|
||||
index 3e6383a..9216ae4 100644
|
||||
--- a/common/options.c
|
||||
+++ b/common/options.c
|
||||
@@ -1122,7 +1122,6 @@ store_options6(char *buf, int buflen,
|
||||
*/
|
||||
if (code == vsio_option_code) {
|
||||
vsio_wanted = 1;
|
||||
- continue;
|
||||
}
|
||||
|
||||
/*
|
@ -0,0 +1,34 @@
|
||||
diff -up dhcp-4.3.1b1/client/dhclient.8.KrJcIv dhcp-4.3.1b1/client/dhclient.8
|
||||
--- dhcp-4.3.1b1/client/dhclient.8.KrJcIv 2014-07-10 17:39:25.852763873 +0200
|
||||
+++ dhcp-4.3.1b1/client/dhclient.8 2014-07-10 17:54:26.841012988 +0200
|
||||
@@ -458,6 +458,9 @@ used to construct a RFC4361 style client
|
||||
in the client's messages. This client id can be overridden by
|
||||
setting a client id in the configuration file. Overridding the
|
||||
client id in this fashion is discouraged.
|
||||
+This option is turned on by default, if you want to redefine or turn off
|
||||
+sending of client id, use send dhcp-client-identifier = "better identifier"
|
||||
+or send dhcp-client-identifier = "" in /etc/dhcp/dhclient.conf.
|
||||
.TP
|
||||
.BI \-I
|
||||
Use the standard DDNS scheme from RFCs 4701 & 4702.
|
||||
diff -up dhcp-4.3.1b1/client/dhclient.c.KrJcIv dhcp-4.3.1b1/client/dhclient.c
|
||||
--- dhcp-4.3.1b1/client/dhclient.c.KrJcIv 2014-07-10 17:54:26.829013157 +0200
|
||||
+++ dhcp-4.3.1b1/client/dhclient.c 2014-07-10 17:55:50.155835918 +0200
|
||||
@@ -73,7 +73,7 @@ struct sockaddr_in sockaddr_broadcast;
|
||||
struct in_addr giaddr;
|
||||
struct data_string default_duid;
|
||||
int duid_type = 0;
|
||||
-int duid_v4 = 0;
|
||||
+int duid_v4 = 1;
|
||||
int std_dhcid = 0;
|
||||
|
||||
/* ASSERT_STATE() does nothing now; it used to be
|
||||
@@ -1301,7 +1301,7 @@ static void setup_ib_interface(struct in
|
||||
}
|
||||
|
||||
/* No client ID specified */
|
||||
- log_fatal("dhcp-client-identifier must be specified for InfiniBand");
|
||||
+ //log_fatal("dhcp-client-identifier must be specified for InfiniBand");
|
||||
}
|
||||
|
||||
/* Individual States:
|
@ -0,0 +1,12 @@
|
||||
diff -up dhcp-4.3.0rc1/common/tables.c.garbage dhcp-4.3.0rc1/common/tables.c
|
||||
--- dhcp-4.3.0rc1/common/tables.c.garbage 2014-01-29 10:03:52.132624677 +0100
|
||||
+++ dhcp-4.3.0rc1/common/tables.c 2014-01-29 10:04:51.413875343 +0100
|
||||
@@ -213,7 +213,7 @@ static struct option dhcp_options[] = {
|
||||
{ "name-service-search", "Sa", &dhcp_universe, 117, 1 },
|
||||
#endif
|
||||
{ "subnet-selection", "I", &dhcp_universe, 118, 1 },
|
||||
- { "domain-search", "Dc", &dhcp_universe, 119, 1 },
|
||||
+ { "domain-search", "D", &dhcp_universe, 119, 1 },
|
||||
{ "vivco", "Evendor-class.", &dhcp_universe, 124, 1 },
|
||||
{ "vivso", "Evendor.", &dhcp_universe, 125, 1 },
|
||||
#if 0
|
@ -0,0 +1,44 @@
|
||||
diff --git a/omapip/isclib.c b/omapip/isclib.c
|
||||
index 9ec1a0f..42d82ff 100644
|
||||
--- a/omapip/isclib.c
|
||||
+++ b/omapip/isclib.c
|
||||
@@ -185,16 +185,6 @@ dhcp_context_create(int flags,
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
- result = isc_app_ctxstart(dhcp_gbl_ctx.actx);
|
||||
- if (result != ISC_R_SUCCESS)
|
||||
- return (result);
|
||||
- dhcp_gbl_ctx.actx_started = ISC_TRUE;
|
||||
-
|
||||
- /* Not all OSs support suppressing SIGPIPE through socket
|
||||
- * options, so set the sigal action to be ignore. This allows
|
||||
- * broken connections to fail gracefully with EPIPE on writes */
|
||||
- handle_signal(SIGPIPE, SIG_IGN);
|
||||
-
|
||||
result = isc_taskmgr_createinctx(dhcp_gbl_ctx.mctx,
|
||||
dhcp_gbl_ctx.actx,
|
||||
1, 0,
|
||||
@@ -217,6 +207,21 @@ dhcp_context_create(int flags,
|
||||
result = isc_task_create(dhcp_gbl_ctx.taskmgr, 0, &dhcp_gbl_ctx.task);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
+
|
||||
+ result = isc_app_ctxstart(dhcp_gbl_ctx.actx);
|
||||
+ if (result != ISC_R_SUCCESS)
|
||||
+ return (result);
|
||||
+ dhcp_gbl_ctx.actx_started = ISC_TRUE;
|
||||
+
|
||||
+ /* Not all OSs support suppressing SIGPIPE through socket
|
||||
+ * options, so set the sigal action to be ignore. This allows
|
||||
+ * broken connections to fail gracefully with EPIPE on writes */
|
||||
+ handle_signal(SIGPIPE, SIG_IGN);
|
||||
+
|
||||
+ /* Reset handlers installed by isc_app_ctxstart()
|
||||
+ * to default for control-c and kill */
|
||||
+ handle_signal(SIGINT, SIG_DFL);
|
||||
+ handle_signal(SIGTERM, SIG_DFL);
|
||||
}
|
||||
|
||||
#if defined (NSUPDATE)
|
||||
|
@ -0,0 +1,49 @@
|
||||
diff -up dhcp-4.3.0a1/client/dhc6.c.honor-expired dhcp-4.3.0a1/client/dhc6.c
|
||||
--- dhcp-4.3.0a1/client/dhc6.c.honor-expired 2013-12-19 16:00:28.062183037 +0100
|
||||
+++ dhcp-4.3.0a1/client/dhc6.c 2013-12-19 16:00:28.076182842 +0100
|
||||
@@ -1351,6 +1351,32 @@ start_info_request6(struct client_state
|
||||
go_daemon();
|
||||
}
|
||||
|
||||
+/* Run through the addresses in lease and return true if there's any unexpired.
|
||||
+ * Return false otherwise.
|
||||
+ */
|
||||
+isc_boolean_t
|
||||
+unexpired_address_in_lease(struct dhc6_lease *lease)
|
||||
+{
|
||||
+ struct dhc6_ia *ia;
|
||||
+ struct dhc6_addr *addr;
|
||||
+
|
||||
+ for (ia = lease->bindings ; ia != NULL ; ia = ia->next) {
|
||||
+ for (addr = ia->addrs ; addr != NULL ; addr = addr->next) {
|
||||
+ if (addr->flags & DHC6_ADDR_EXPIRED)
|
||||
+ continue;
|
||||
+
|
||||
+ if (addr->starts + addr->max_life > cur_time) {
|
||||
+ return ISC_TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ log_info("PRC: Previous lease is devoid of active addresses."
|
||||
+ " Re-initializing.");
|
||||
+
|
||||
+ return ISC_FALSE;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* start_confirm6() kicks off an "init-reboot" version of the process, at
|
||||
* startup to find out if old bindings are 'fair' and at runtime whenever
|
||||
@@ -1363,8 +1389,10 @@ start_confirm6(struct client_state *clie
|
||||
|
||||
/* If there is no active lease, there is nothing to check. */
|
||||
if ((client->active_lease == NULL) ||
|
||||
- !active_prefix(client) ||
|
||||
- client->active_lease->released) {
|
||||
+ !active_prefix(client) ||
|
||||
+ client->active_lease->released ||
|
||||
+ !unexpired_address_in_lease(client->active_lease)) {
|
||||
+ dhc6_lease_destroy(&client->active_lease, MDL);
|
||||
start_init6(client);
|
||||
return;
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
diff -up dhcp-4.3.4/client/dhclient.c.improved-xid dhcp-4.3.4/client/dhclient.c
|
||||
--- dhcp-4.3.4/client/dhclient.c.improved-xid 2016-04-29 12:54:55.997102182 +0200
|
||||
+++ dhcp-4.3.4/client/dhclient.c 2016-04-29 12:57:25.123139587 +0200
|
||||
@@ -1045,6 +1045,26 @@ main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
+ /* We create a backup seed before rediscovering interfaces in order to
|
||||
+ have a seed built using all of the available interfaces
|
||||
+ It's interesting if required interfaces doesn't let us defined
|
||||
+ a really unique seed due to a lack of valid HW addr later
|
||||
+ (this is the case with DHCP over IB)
|
||||
+ We only use the last device as using a sum could broke the
|
||||
+ uniqueness of the seed among multiple nodes
|
||||
+ */
|
||||
+ unsigned backup_seed = 0;
|
||||
+ for (ip = interfaces; ip; ip = ip -> next) {
|
||||
+ int junk;
|
||||
+ if ( ip -> hw_address.hlen <= sizeof seed )
|
||||
+ continue;
|
||||
+ memcpy (&junk,
|
||||
+ &ip -> hw_address.hbuf [ip -> hw_address.hlen -
|
||||
+ sizeof seed], sizeof seed);
|
||||
+ backup_seed = junk;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
/* At this point, all the interfaces that the script thinks
|
||||
are relevant should be running, so now we once again call
|
||||
discover_interfaces(), and this time ask it to actually set
|
||||
@@ -1059,14 +1079,36 @@ main(int argc, char **argv) {
|
||||
Not much entropy, but we're booting, so we're not likely to
|
||||
find anything better. */
|
||||
seed = 0;
|
||||
+ int seed_flag = 0;
|
||||
for (ip = interfaces; ip; ip = ip->next) {
|
||||
int junk;
|
||||
+ if ( ip -> hw_address.hlen <= sizeof seed )
|
||||
+ continue;
|
||||
memcpy(&junk,
|
||||
&ip->hw_address.hbuf[ip->hw_address.hlen -
|
||||
sizeof seed], sizeof seed);
|
||||
seed += junk;
|
||||
+ seed_flag = 1;
|
||||
}
|
||||
- srandom(seed + cur_time + (unsigned)getpid());
|
||||
+ if ( seed_flag == 0 ) {
|
||||
+ if ( backup_seed != 0 ) {
|
||||
+ seed = backup_seed;
|
||||
+ log_info ("xid: rand init seed (0x%x) built using all"
|
||||
+ " available interfaces",seed);
|
||||
+ }
|
||||
+ else {
|
||||
+ seed = cur_time^((unsigned) gethostid()) ;
|
||||
+ log_info ("xid: warning: no netdev with useable HWADDR found"
|
||||
+ " for seed's uniqueness enforcement");
|
||||
+ log_info ("xid: rand init seed (0x%x) built using gethostid",
|
||||
+ seed);
|
||||
+ }
|
||||
+ /* we only use seed and no current time as a broadcast reply */
|
||||
+ /* will certainly be used by the hwaddrless interface */
|
||||
+ srandom(seed + ((unsigned)(cur_tv.tv_usec * 1000000)) + (unsigned)getpid());
|
||||
+ }
|
||||
+ else
|
||||
+ srandom(seed + ((unsigned)(cur_tv.tv_usec * 1000000)) + (unsigned)getpid());
|
||||
|
||||
/* Setup specific Infiniband options */
|
||||
for (ip = interfaces; ip; ip = ip->next) {
|
||||
@@ -1633,7 +1675,7 @@ void dhcpack (packet)
|
||||
return;
|
||||
}
|
||||
|
||||
- log_info ("DHCPACK from %s", piaddr (packet -> client_addr));
|
||||
+ log_info ("DHCPACK from %s (xid=0x%x)", piaddr (packet -> client_addr), ntohl(client -> xid));
|
||||
|
||||
lease = packet_to_lease (packet, client);
|
||||
if (!lease) {
|
||||
@@ -2541,7 +2583,7 @@ void dhcpnak (packet)
|
||||
return;
|
||||
}
|
||||
|
||||
- log_info ("DHCPNAK from %s", piaddr (packet -> client_addr));
|
||||
+ log_info ("DHCPNAK from %s (xid=0x%x)", piaddr (packet -> client_addr), ntohl(client -> xid));
|
||||
|
||||
if (!client -> active) {
|
||||
#if defined (DEBUG)
|
||||
@@ -2674,10 +2716,10 @@ void send_discover (cpp)
|
||||
(long)(client -> interval));
|
||||
} else
|
||||
#endif
|
||||
- log_info ("DHCPDISCOVER on %s to %s port %d interval %ld",
|
||||
+ log_info ("DHCPDISCOVER on %s to %s port %d interval %ld (xid=0x%x)",
|
||||
client -> name ? client -> name : client -> interface -> name,
|
||||
inet_ntoa (sockaddr_broadcast.sin_addr),
|
||||
- ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval));
|
||||
+ ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval), ntohl(client -> xid));
|
||||
|
||||
/* Send out a packet. */
|
||||
#if defined(DHCPv6) && defined(DHCP4o6)
|
||||
@@ -2962,10 +3004,10 @@ void send_request (cpp)
|
||||
log_info ("DHCPREQUEST");
|
||||
} else
|
||||
#endif
|
||||
- log_info ("DHCPREQUEST on %s to %s port %d",
|
||||
+ log_info ("DHCPREQUEST on %s to %s port %d (xid=0x%x)",
|
||||
client -> name ? client -> name : client -> interface -> name,
|
||||
inet_ntoa (destination.sin_addr),
|
||||
- ntohs (destination.sin_port));
|
||||
+ ntohs (destination.sin_port), ntohl(client -> xid));
|
||||
|
||||
#if defined(DHCPv6) && defined(DHCP4o6)
|
||||
if (dhcpv4_over_dhcpv6) {
|
||||
@@ -3022,10 +3064,10 @@ void send_decline (cpp)
|
||||
log_info ("DHCPDECLINE");
|
||||
} else
|
||||
#endif
|
||||
- log_info ("DHCPDECLINE on %s to %s port %d",
|
||||
+ log_info ("DHCPDECLINE on %s to %s port %d (xid=0x%x)",
|
||||
client->name ? client->name : client->interface->name,
|
||||
inet_ntoa(sockaddr_broadcast.sin_addr),
|
||||
- ntohs(sockaddr_broadcast.sin_port));
|
||||
+ ntohs(sockaddr_broadcast.sin_port), ntohl(client -> xid));
|
||||
|
||||
/* Send out a packet. */
|
||||
#if defined(DHCPv6) && defined(DHCP4o6)
|
||||
@@ -3084,10 +3126,10 @@ void send_release (cpp)
|
||||
log_info ("DHCPRELEASE");
|
||||
} else
|
||||
#endif
|
||||
- log_info ("DHCPRELEASE on %s to %s port %d",
|
||||
+ log_info ("DHCPRELEASE on %s to %s port %d (xid=0x%x)",
|
||||
client -> name ? client -> name : client -> interface -> name,
|
||||
inet_ntoa (destination.sin_addr),
|
||||
- ntohs (destination.sin_port));
|
||||
+ ntohs (destination.sin_port), ntohl(client -> xid));
|
||||
|
||||
#if defined(DHCPv6) && defined(DHCP4o6)
|
||||
if (dhcpv4_over_dhcpv6) {
|
@ -0,0 +1,164 @@
|
||||
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
|
||||
index aac2c108..c83dc9a6 100644
|
||||
--- a/includes/dhcpd.h
|
||||
+++ b/includes/dhcpd.h
|
||||
@@ -1622,8 +1622,9 @@ struct iasubopt {
|
||||
*/
|
||||
#define EXPIRED_IPV6_CLEANUP_TIME (60*60)
|
||||
|
||||
- int heap_index; /* index into heap, or -1
|
||||
- (internal use only) */
|
||||
+ /* index into heaps, or -1 (internal use only) */
|
||||
+ int active_index;
|
||||
+ int inactive_index;
|
||||
|
||||
/*
|
||||
* A pointer to the state of the ddns update for this lease.
|
||||
diff --git a/server/mdb6.c b/server/mdb6.c
|
||||
index 1a728eb3..418ff606 100644
|
||||
--- a/server/mdb6.c
|
||||
+++ b/server/mdb6.c
|
||||
@@ -216,7 +216,8 @@ iasubopt_allocate(struct iasubopt **iasubopt, const char *file, int line) {
|
||||
|
||||
tmp->refcnt = 1;
|
||||
tmp->state = FTS_FREE;
|
||||
- tmp->heap_index = -1;
|
||||
+ tmp->active_index = -1;
|
||||
+ tmp->inactive_index = -1;
|
||||
tmp->plen = 255;
|
||||
|
||||
*iasubopt = tmp;
|
||||
@@ -604,10 +605,14 @@ lease_older(void *a, void *b) {
|
||||
* Callback when an address's position in the heap changes.
|
||||
*/
|
||||
static void
|
||||
-lease_index_changed(void *iasubopt, unsigned int new_heap_index) {
|
||||
- ((struct iasubopt *)iasubopt)-> heap_index = new_heap_index;
|
||||
+active_changed(void *iasubopt, unsigned int new_heap_index) {
|
||||
+ ((struct iasubopt *)iasubopt)-> active_index = new_heap_index;
|
||||
}
|
||||
|
||||
+static void
|
||||
+inactive_changed(void *iasubopt, unsigned int new_heap_index) {
|
||||
+ ((struct iasubopt *)iasubopt)-> inactive_index = new_heap_index;
|
||||
+}
|
||||
|
||||
/*!
|
||||
*
|
||||
@@ -660,13 +665,13 @@ ipv6_pool_allocate(struct ipv6_pool **pool, u_int16_t type,
|
||||
dfree(tmp, file, line);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
- if (isc_heap_create(dhcp_gbl_ctx.mctx, lease_older, lease_index_changed,
|
||||
+ if (isc_heap_create(dhcp_gbl_ctx.mctx, lease_older, active_changed,
|
||||
0, &(tmp->active_timeouts)) != ISC_R_SUCCESS) {
|
||||
iasubopt_free_hash_table(&(tmp->leases), file, line);
|
||||
dfree(tmp, file, line);
|
||||
return ISC_R_NOMEMORY;
|
||||
}
|
||||
- if (isc_heap_create(dhcp_gbl_ctx.mctx, lease_older, lease_index_changed,
|
||||
+ if (isc_heap_create(dhcp_gbl_ctx.mctx, lease_older, inactive_changed,
|
||||
0, &(tmp->inactive_timeouts)) != ISC_R_SUCCESS) {
|
||||
isc_heap_destroy(&(tmp->active_timeouts));
|
||||
iasubopt_free_hash_table(&(tmp->leases), file, line);
|
||||
@@ -1361,7 +1366,7 @@ cleanup_lease6(ia_hash_t *ia_table,
|
||||
* Remove the old lease from the active heap and from the hash table
|
||||
* then remove the lease from the IA and clean up the IA if necessary.
|
||||
*/
|
||||
- isc_heap_delete(pool->active_timeouts, test_iasubopt->heap_index);
|
||||
+ isc_heap_delete(pool->active_timeouts, test_iasubopt->active_index);
|
||||
pool->num_active--;
|
||||
if (pool->ipv6_pond)
|
||||
pool->ipv6_pond->num_active--;
|
||||
@@ -1434,7 +1439,7 @@ add_lease6(struct ipv6_pool *pool, struct iasubopt *lease,
|
||||
if ((test_iasubopt->state == FTS_ACTIVE) ||
|
||||
(test_iasubopt->state == FTS_ABANDONED)) {
|
||||
isc_heap_delete(pool->active_timeouts,
|
||||
- test_iasubopt->heap_index);
|
||||
+ test_iasubopt->active_index);
|
||||
pool->num_active--;
|
||||
if (pool->ipv6_pond)
|
||||
pool->ipv6_pond->num_active--;
|
||||
@@ -1446,7 +1451,7 @@ add_lease6(struct ipv6_pool *pool, struct iasubopt *lease,
|
||||
}
|
||||
} else {
|
||||
isc_heap_delete(pool->inactive_timeouts,
|
||||
- test_iasubopt->heap_index);
|
||||
+ test_iasubopt->inactive_index);
|
||||
pool->num_inactive--;
|
||||
}
|
||||
|
||||
@@ -1567,14 +1572,13 @@ lease6_usable(struct iasubopt *lease) {
|
||||
static isc_result_t
|
||||
move_lease_to_active(struct ipv6_pool *pool, struct iasubopt *lease) {
|
||||
isc_result_t insert_result;
|
||||
- int old_heap_index;
|
||||
|
||||
- old_heap_index = lease->heap_index;
|
||||
insert_result = isc_heap_insert(pool->active_timeouts, lease);
|
||||
if (insert_result == ISC_R_SUCCESS) {
|
||||
iasubopt_hash_add(pool->leases, &lease->addr,
|
||||
sizeof(lease->addr), lease, MDL);
|
||||
- isc_heap_delete(pool->inactive_timeouts, old_heap_index);
|
||||
+ isc_heap_delete(pool->inactive_timeouts,
|
||||
+ lease->inactive_index);
|
||||
pool->num_active++;
|
||||
pool->num_inactive--;
|
||||
lease->state = FTS_ACTIVE;
|
||||
@@ -1624,16 +1628,16 @@ renew_lease6(struct ipv6_pool *pool, struct iasubopt *lease) {
|
||||
if (lease->state == FTS_ACTIVE) {
|
||||
if (old_end_time <= lease->hard_lifetime_end_time) {
|
||||
isc_heap_decreased(pool->active_timeouts,
|
||||
- lease->heap_index);
|
||||
+ lease->active_index);
|
||||
} else {
|
||||
isc_heap_increased(pool->active_timeouts,
|
||||
- lease->heap_index);
|
||||
+ lease->active_index);
|
||||
}
|
||||
return ISC_R_SUCCESS;
|
||||
} else if (lease->state == FTS_ABANDONED) {
|
||||
char tmp_addr[INET6_ADDRSTRLEN];
|
||||
lease->state = FTS_ACTIVE;
|
||||
- isc_heap_increased(pool->active_timeouts, lease->heap_index);
|
||||
+ isc_heap_increased(pool->active_timeouts, lease->active_index);
|
||||
log_info("Reclaiming previously abandoned address %s",
|
||||
inet_ntop(AF_INET6, &(lease->addr), tmp_addr,
|
||||
sizeof(tmp_addr)));
|
||||
@@ -1655,9 +1659,7 @@ static isc_result_t
|
||||
move_lease_to_inactive(struct ipv6_pool *pool, struct iasubopt *lease,
|
||||
binding_state_t state) {
|
||||
isc_result_t insert_result;
|
||||
- int old_heap_index;
|
||||
|
||||
- old_heap_index = lease->heap_index;
|
||||
insert_result = isc_heap_insert(pool->inactive_timeouts, lease);
|
||||
if (insert_result == ISC_R_SUCCESS) {
|
||||
/*
|
||||
@@ -1708,7 +1710,7 @@ move_lease_to_inactive(struct ipv6_pool *pool, struct iasubopt *lease,
|
||||
|
||||
iasubopt_hash_delete(pool->leases,
|
||||
&lease->addr, sizeof(lease->addr), MDL);
|
||||
- isc_heap_delete(pool->active_timeouts, old_heap_index);
|
||||
+ isc_heap_delete(pool->active_timeouts, lease->active_index);
|
||||
lease->state = state;
|
||||
pool->num_active--;
|
||||
pool->num_inactive++;
|
||||
@@ -1786,7 +1788,7 @@ decline_lease6(struct ipv6_pool *pool, struct iasubopt *lease) {
|
||||
pool->ipv6_pond->num_abandoned++;
|
||||
|
||||
lease->hard_lifetime_end_time = MAX_TIME;
|
||||
- isc_heap_decreased(pool->active_timeouts, lease->heap_index);
|
||||
+ isc_heap_decreased(pool->active_timeouts, lease->active_index);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2059,7 +2061,7 @@ cleanup_old_expired(struct ipv6_pool *pool) {
|
||||
break;
|
||||
}
|
||||
|
||||
- isc_heap_delete(pool->inactive_timeouts, tmp->heap_index);
|
||||
+ isc_heap_delete(pool->inactive_timeouts, tmp->inactive_index);
|
||||
pool->num_inactive--;
|
||||
|
||||
if (tmp->ia != NULL) {
|
@ -0,0 +1,200 @@
|
||||
From e6ffc27f24321017a5ad9af3707f4e2e54bbac74 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Markwalder <tmark@isc.org>
|
||||
Date: Mon, 11 Dec 2017 07:19:43 -0500
|
||||
Subject: [PATCH] [master] Adds key-algorithm statement to omshell
|
||||
|
||||
Merges in rt46771.
|
||||
---
|
||||
RELNOTES | 7 +++++++
|
||||
common/conflex.c | 2 ++
|
||||
dhcpctl/omshell.1 | 32 ++++++++++++++++++++++++--------
|
||||
dhcpctl/omshell.c | 38 +++++++++++++++++++++++++++++++++++---
|
||||
includes/dhctoken.h | 3 ++-
|
||||
5 files changed, 70 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/common/conflex.c b/common/conflex.c
|
||||
index 8ce024af..045b655d 100644
|
||||
--- a/common/conflex.c
|
||||
+++ b/common/conflex.c
|
||||
@@ -1104,6 +1104,8 @@ intern(char *atom, enum dhcp_token dfv) {
|
||||
}
|
||||
if (!strcasecmp (atom + 1, "ey"))
|
||||
return KEY;
|
||||
+ if (!strcasecmp (atom + 1, "ey-algorithm"))
|
||||
+ return KEY_ALGORITHM;
|
||||
break;
|
||||
case 'l':
|
||||
if (!strcasecmp (atom + 1, "case"))
|
||||
diff --git a/dhcpctl/omshell.1 b/dhcpctl/omshell.1
|
||||
index 4846272a..2f55e965 100644
|
||||
--- a/dhcpctl/omshell.1
|
||||
+++ b/dhcpctl/omshell.1
|
||||
@@ -1,7 +1,6 @@
|
||||
.\" $Id: omshell.1,v 1.6 2009/11/24 02:06:56 sar Exp $
|
||||
.\"
|
||||
-.\" Copyright (c) 2012,2014 by Internet Systems Consortium, Inc. ("ISC")
|
||||
-.\" Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC")
|
||||
+.\" Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
|
||||
.\" Copyright (c) 2001-2003 by Internet Software Consortium
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -81,7 +80,24 @@ where number is the port that OMAPI listens on. By default, this is 7911.
|
||||
This specifies the TSIG key to use to authenticate the OMAPI transactions.
|
||||
\fIname\fR is the name of a key defined in \fIdhcpd.conf\fR with the
|
||||
\fBomapi-key\fR statement. The \fIsecret\fR is the secret key generated from
|
||||
-\fBdnssec-keygen\fR or another key generation program.
|
||||
+\fBdnssec-keygen\fR or another key generation program. The key algorithm is
|
||||
+assumed to be HMAC-MD5 key. If a different algorithm was specified in dhcpd.conf
|
||||
+file for the key, then it must be specified via the \fIkey-algorithm\fR statement.
|
||||
+.RE
|
||||
+.PP
|
||||
+.B key-algorithm \fIalgorithm\fR
|
||||
+.RS 0.5i
|
||||
+This specifies the cryptographic algorithm for the key used when authenticating OMAPI
|
||||
+transactions. Supported values for \fIalgorithm\fR are:
|
||||
+.nf
|
||||
+ HMAC-MD5
|
||||
+ HMAC-SHA1
|
||||
+ HMAC-SHA224
|
||||
+ HMAC-SHA256
|
||||
+ HMAC-SHA384
|
||||
+ HMAC-SHA512
|
||||
+fi
|
||||
+The default is HMAC-MD5. (Value is not case sensitive).
|
||||
.RE
|
||||
.PP
|
||||
.B connect
|
||||
@@ -253,7 +269,7 @@ name = "some-host"
|
||||
hardware-address = 00:80:c7:84:b1:94
|
||||
hardware-type = 00:00:00:01
|
||||
ip-address = c0:a8:04:28
|
||||
->
|
||||
+>
|
||||
.fi
|
||||
.PP
|
||||
Your dhcpd.leases file would then have an entry like this in it:
|
||||
@@ -267,7 +283,7 @@ host some-host {
|
||||
.fi
|
||||
.PP
|
||||
The \fIdynamic;\fR line is to denote that this host entry did not come from
|
||||
-dhcpd.conf, but was created dynamically via OMAPI.
|
||||
+dhcpd.conf, but was created dynamically via OMAPI.
|
||||
.SH RESETTING ATTRIBUTES
|
||||
.PP
|
||||
If you want to remove an attribute from an object, you can do this with the
|
||||
@@ -288,7 +304,7 @@ name = "some-host"
|
||||
hardware-address = 00:80:c7:84:b1:94
|
||||
hardware-type = 00:00:00:01
|
||||
ip-address = <null>
|
||||
->
|
||||
+>
|
||||
.fi
|
||||
.SH REFRESHING OBJECTS
|
||||
.PP
|
||||
@@ -300,7 +316,7 @@ particularly useful for hosts.
|
||||
.PP
|
||||
Any remote object that can be created can also be destroyed. This is done by
|
||||
creating a new local object, setting attributes, associating the local and
|
||||
-remote object using \fBopen\fR, and then using the \fBremove\fR command.
|
||||
+remote object using \fBopen\fR, and then using the \fBremove\fR command.
|
||||
If the host "some-host" from before was created in error, this could be
|
||||
corrected as follows:
|
||||
.nf
|
||||
@@ -312,7 +328,7 @@ hardware-type = 00:00:00:01
|
||||
ip-address = c0:a8:04:28
|
||||
> remove
|
||||
obj: <null>
|
||||
->
|
||||
+>
|
||||
.fi
|
||||
.SH HELP
|
||||
.PP
|
||||
diff --git a/dhcpctl/omshell.c b/dhcpctl/omshell.c
|
||||
index c42bab1a..9233f50e 100644
|
||||
--- a/dhcpctl/omshell.c
|
||||
+++ b/dhcpctl/omshell.c
|
||||
@@ -321,12 +321,42 @@ main(int argc, char **argv) {
|
||||
}
|
||||
break;
|
||||
|
||||
+ case KEY_ALGORITHM:
|
||||
+ /* Algorithm is optional */
|
||||
+ token = next_token (&val, (unsigned *)0, cfile);
|
||||
+ if (token != NAME || !is_identifier(token)) {
|
||||
+ printf ("missing or invalid algorithm name\n");
|
||||
+ printf ("usage: key-algoritm <algorithm name>\n");
|
||||
+ skip_to_semi (cfile);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ s = dmalloc (strlen (val) + 1, MDL);
|
||||
+ if (!s) {
|
||||
+ printf ("no memory for algorithm name.\n");
|
||||
+ skip_to_semi (cfile);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ strcpy (s, val);
|
||||
+ algorithm = s;
|
||||
+
|
||||
+ token = next_token (&val, (unsigned *)0, cfile);
|
||||
+ if (token != END_OF_FILE && token != EOL) {
|
||||
+ printf ("extra information after %s\n", algorithm);
|
||||
+ printf ("usage: key-algorithm <algorithm name>\n");
|
||||
+ skip_to_semi (cfile);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ break;
|
||||
+
|
||||
case KEY:
|
||||
token = peek_token(&val, (unsigned *)0, cfile);
|
||||
if (token == STRING) {
|
||||
token = next_token (&val, (unsigned *)0, cfile);
|
||||
if (!is_identifier (token)) {
|
||||
- printf ("usage: key <name> <value>\n");
|
||||
+ printf ("usage: key <name> <value>\n");
|
||||
skip_to_semi (cfile);
|
||||
break;
|
||||
}
|
||||
@@ -340,7 +370,7 @@ main(int argc, char **argv) {
|
||||
} else {
|
||||
s = parse_host_name(cfile);
|
||||
if (s == NULL) {
|
||||
- printf ("usage: key <name> <value>\n");
|
||||
+ printf ("usage: key <name> <value>\n");
|
||||
skip_to_semi(cfile);
|
||||
break;
|
||||
}
|
||||
@@ -352,12 +382,14 @@ main(int argc, char **argv) {
|
||||
skip_to_semi (cfile);
|
||||
break;
|
||||
}
|
||||
+
|
||||
token = next_token (&val, (unsigned *)0, cfile);
|
||||
if (token != END_OF_FILE && token != EOL) {
|
||||
- printf ("usage: key <name> <secret>\n");
|
||||
+ printf ("usage: key <name> <value> {algorithm}\n");
|
||||
skip_to_semi (cfile);
|
||||
break;
|
||||
}
|
||||
+
|
||||
break;
|
||||
|
||||
case CONNECT:
|
||||
diff --git a/includes/dhctoken.h b/includes/dhctoken.h
|
||||
index 6fc4df3..ca24d4c 100644
|
||||
--- a/includes/dhctoken.h
|
||||
+++ b/includes/dhctoken.h
|
||||
@@ -374,8 +374,9 @@ enum dhcp_token {
|
||||
LEASE_ID_FORMAT = 676,
|
||||
TOKEN_HEX = 677,
|
||||
TOKEN_OCTAL = 678,
|
||||
- BOOTP_BROADCAST_ALWAYS = 679,
|
||||
- DESTINATION_DESCRIPTOR = 680
|
||||
+ KEY_ALGORITHM = 679,
|
||||
+ BOOTP_BROADCAST_ALWAYS = 680,
|
||||
+ DESTINATION_DESCRIPTOR = 681
|
||||
};
|
||||
|
||||
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|
@ -0,0 +1,38 @@
|
||||
diff -up dhcp-4.3.0a1/doc/examples/dhcpd-dhcpv6.conf.paths dhcp-4.3.0a1/doc/examples/dhcpd-dhcpv6.conf
|
||||
--- dhcp-4.3.0a1/doc/examples/dhcpd-dhcpv6.conf.paths 2013-11-07 20:15:08.000000000 +0100
|
||||
+++ dhcp-4.3.0a1/doc/examples/dhcpd-dhcpv6.conf 2013-12-19 15:34:16.262247711 +0100
|
||||
@@ -42,7 +42,7 @@ option dhcp6.domain-search "test.example
|
||||
option dhcp6.info-refresh-time 21600;
|
||||
|
||||
# The path of the lease file
|
||||
-dhcpv6-lease-file-name "/usr/local/var/db/dhcpd6.leases";
|
||||
+dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases";
|
||||
|
||||
# Static definition (must be global)
|
||||
host myclient {
|
||||
diff -up dhcp-4.3.0a1/includes/dhcpd.h.paths dhcp-4.3.0a1/includes/dhcpd.h
|
||||
--- dhcp-4.3.0a1/includes/dhcpd.h.paths 2013-12-19 15:34:16.253247840 +0100
|
||||
+++ dhcp-4.3.0a1/includes/dhcpd.h 2013-12-19 15:34:16.263247697 +0100
|
||||
@@ -1429,7 +1429,7 @@ typedef unsigned char option_mask [16];
|
||||
#else /* !DEBUG */
|
||||
|
||||
#ifndef _PATH_DHCPD_CONF
|
||||
-#define _PATH_DHCPD_CONF "/etc/dhcpd.conf"
|
||||
+#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef _PATH_DHCPD_DB
|
||||
@@ -1451,11 +1451,11 @@ typedef unsigned char option_mask [16];
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef _PATH_DHCLIENT_CONF
|
||||
-#define _PATH_DHCLIENT_CONF "/etc/dhclient.conf"
|
||||
+#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
|
||||
#endif
|
||||
|
||||
#ifndef _PATH_DHCLIENT_SCRIPT
|
||||
-#define _PATH_DHCLIENT_SCRIPT "/sbin/dhclient-script"
|
||||
+#define _PATH_DHCLIENT_SCRIPT "/usr/sbin/dhclient-script"
|
||||
#endif
|
||||
|
||||
#ifndef _PATH_DHCLIENT_PID
|
@ -0,0 +1,351 @@
|
||||
From 2698385647a6ebd58b5d25147333e494c3da2409 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Fri, 9 Feb 2018 15:24:53 +0100
|
||||
Subject: [PATCH] Support for isc-config.sh script on --with-libbind parameter
|
||||
|
||||
Move checks only to isc-config section
|
||||
|
||||
Fix detection of bind flags from config
|
||||
|
||||
Add support for with-libbind=config, Improve help message
|
||||
---
|
||||
client/Makefile.am | 5 ++-
|
||||
client/tests/Makefile.am | 8 ++---
|
||||
common/tests/Makefile.am | 14 +++-----
|
||||
configure.ac | 84 ++++++++++++++++++++++++++++++++++++++++++------
|
||||
dhcpctl/Makefile.am | 8 ++---
|
||||
omapip/Makefile.am | 5 ++-
|
||||
relay/Makefile.am | 5 ++-
|
||||
server/Makefile.am | 6 ++--
|
||||
server/tests/Makefile.am | 9 +++---
|
||||
9 files changed, 98 insertions(+), 46 deletions(-)
|
||||
|
||||
diff --git a/client/Makefile.am b/client/Makefile.am
|
||||
index 2cb83d8..b85f5d2 100644
|
||||
--- a/client/Makefile.am
|
||||
+++ b/client/Makefile.am
|
||||
@@ -4,7 +4,7 @@
|
||||
# production code. Sadly, we are not there yet.
|
||||
SUBDIRS = . tests
|
||||
|
||||
-BINDLIBDIR = @BINDDIR@/lib
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
|
||||
-DLOCALSTATEDIR='"$(localstatedir)"'
|
||||
@@ -15,7 +15,6 @@ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
|
||||
scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
|
||||
scripts/netbsd scripts/nextstep scripts/openbsd \
|
||||
scripts/solaris scripts/openwrt
|
||||
-dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
|
||||
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(BIND_LIBS)
|
||||
man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
diff --git a/client/tests/Makefile.am b/client/tests/Makefile.am
|
||||
index 5031d0c..bb1fda4 100644
|
||||
--- a/client/tests/Makefile.am
|
||||
+++ b/client/tests/Makefile.am
|
||||
@@ -1,9 +1,9 @@
|
||||
SUBDIRS = .
|
||||
|
||||
-BINDLIBDIR = @BINDDIR@/lib
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes
|
||||
-AM_CPPFLAGS += -I@BINDDIR@/include -I$(top_srcdir)
|
||||
+AM_CPPFLAGS += @BIND_CPPFLAGS@ -I$(top_srcdir)
|
||||
AM_CPPFLAGS += -DLOCALSTATEDIR='"."'
|
||||
AM_CPPFLAGS += -DCLIENT_PATH='"."'
|
||||
|
||||
@@ -18,9 +18,7 @@ info:
|
||||
DHCPSRC = ../clparse.c ../dhc6.c ../dhclient.c
|
||||
|
||||
DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \
|
||||
- $(top_builddir)/dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
|
||||
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
|
||||
- $(BINDLIBDIR)/libisc.a
|
||||
+ $(top_builddir)/dhcpctl/libdhcpctl.a $(BIND_LIBS)
|
||||
|
||||
ATF_TESTS =
|
||||
if HAVE_ATF
|
||||
diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
|
||||
index f6a43e4..196aa44 100644
|
||||
--- a/common/tests/Makefile.am
|
||||
+++ b/common/tests/Makefile.am
|
||||
@@ -1,6 +1,6 @@
|
||||
SUBDIRS = .
|
||||
|
||||
-BINDLIBDIR = @BINDDIR@/lib
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = $(ATF_CFLAGS) -I$(top_srcdir)/includes
|
||||
|
||||
@@ -15,26 +15,22 @@ ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest
|
||||
alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
alloc_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
alloc_unittest_LDADD += ../libdhcp.a \
|
||||
- ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
|
||||
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+ ../../omapip/libomapi.a $(BIND_LIBS)
|
||||
|
||||
dns_unittest_SOURCES = dns_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
dns_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
dns_unittest_LDADD += ../libdhcp.a \
|
||||
- ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
|
||||
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+ ../../omapip/libomapi.a $(BIND_LIBS)
|
||||
|
||||
misc_unittest_SOURCES = misc_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
misc_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
misc_unittest_LDADD += ../libdhcp.a \
|
||||
- ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
|
||||
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+ ../../omapip/libomapi.a $(BIND_LIBS)
|
||||
|
||||
ns_name_unittest_SOURCES = ns_name_test.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
ns_name_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
ns_name_unittest_LDADD += ../libdhcp.a \
|
||||
- ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
|
||||
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+ ../../omapip/libomapi.a $(BIND_LIBS)
|
||||
|
||||
check: $(ATF_TESTS)
|
||||
@if test $(top_srcdir) != ${top_builddir}; then \
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cdfa352..ef55f8d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -688,8 +688,12 @@ AC_CHECK_MEMBER(struct tpacket_auxdata.tp_vlan_tci,
|
||||
|
||||
BINDDIR=
|
||||
BINDSRCDIR=
|
||||
+BIND_CONFIG=
|
||||
+BIND_CPPFLAGS=
|
||||
+BIND_LIBS=
|
||||
AC_ARG_WITH(libbind,
|
||||
- AS_HELP_STRING([--with-libbind=PATH],[bind includes and libraries are in PATH
|
||||
+ AS_HELP_STRING([--with-libbind=PATH|config],[bind includes and libraries are in PATH.
|
||||
+ Use config to obtain libraries from isc-config.sh.
|
||||
(default is ./bind)]),
|
||||
use_libbind="$withval", use_libbind="no")
|
||||
case "$use_libbind" in
|
||||
@@ -701,23 +705,85 @@ no)
|
||||
BINDDIR="\${top_srcdir}/bind"
|
||||
BINDSRCDIR="\${top_srcdir}/bind"
|
||||
;;
|
||||
+config)
|
||||
+ AC_PATH_PROG(BIND_CONFIG, [isc-config.sh bind9-config])
|
||||
+ ;;
|
||||
*)
|
||||
- BINDDIR="$use_libbind"
|
||||
- if test ! -d "$srcdir/bind"; then
|
||||
- # no bind directory, create it with a fake Makefile.in
|
||||
- # (AC_CONFIG_FILES and top Makefile refer to it so
|
||||
- # it must exits)
|
||||
- mkdir $srcdir/bind
|
||||
- cat > $srcdir/bind/Makefile.in << EOF
|
||||
+ if test -f "$use_libbind" -a -x "$use_libbind"; then
|
||||
+ # passed full path of isc-config.sh
|
||||
+ BIND_CONFIG="$use_libbind"
|
||||
+ else
|
||||
+ BINDDIR="$use_libbind"
|
||||
+ if test ! -d "$srcdir/bind"; then
|
||||
+ # no bind directory, create it with a fake Makefile.in
|
||||
+ # (AC_CONFIG_FILES and top Makefile refer to it so
|
||||
+ # it must exits)
|
||||
+ mkdir $srcdir/bind
|
||||
+ cat > $srcdir/bind/Makefile.in << EOF
|
||||
# placeholder
|
||||
all check clean distclean distdir install uninstall:
|
||||
|
||||
EOF
|
||||
+ fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
+if test -z "$BIND_CONFIG"; then
|
||||
+ BIND_CPPFLAGS="-I${BINDDIR}/include"
|
||||
+ BIND_LIBDIR="${BINDDIR}/lib"
|
||||
+ BIND_LIBS="$(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a"
|
||||
+else
|
||||
+ BIND_CPPFLAGS=`$BIND_CONFIG --cflags`
|
||||
+ BIND_LIBS=`$BIND_CONFIG --libs irs dns isccfg isc`
|
||||
+
|
||||
+ # bind is already built
|
||||
+ AC_CHECKING([Checking bind libraries have no thread support])
|
||||
+ saved_libs="$LIBS"
|
||||
+ saved_CPPFLAGS="$CPPFLAGS"
|
||||
+ CPPFLAGS="${CPPFLAGS} ${BIND_CPPFLAGS}"
|
||||
+ LIBS="${LIBS} ${BIND_LIBS}"
|
||||
+AC_TRY_LINK([
|
||||
+#include <isc/bind9.h>
|
||||
+#include <isc/lib.h>
|
||||
+],[
|
||||
+#ifdef BIND9
|
||||
+#error Export BIND library has to be used with BIND version up to 9.9
|
||||
+#endif
|
||||
+isc_lib_register();
|
||||
+], [AC_MSG_RESULT(Bind export library found)
|
||||
+ BIND_EXPORT=yes], [BIND_EXPORT=no]
|
||||
+)
|
||||
+
|
||||
+# Allow build with disabled threads for dhcp
|
||||
+AC_TRY_LINK([
|
||||
+#include <isc/platform.h>
|
||||
+#include <isc/bind9.h>
|
||||
+#include <isc/lib.h>
|
||||
+],[
|
||||
+#ifdef ISC_PLATFORM_USETHREADS
|
||||
+#error Bind library must not be compiled with threads
|
||||
+#endif
|
||||
+isc_lib_register();
|
||||
+if (isc_bind9 != 0) {}
|
||||
+], [AC_MSG_RESULT(Bind single thread library found)
|
||||
+ BIND_SINGLETHREAD=yes], [BIND_SINGLETHREAD=no]
|
||||
+)
|
||||
+
|
||||
+ if test "x$BIND_EXPORT" != xyes -a "x$BIND_SINGLETHREADED" != xyes
|
||||
+ then
|
||||
+ AC_MSG_RESULT([BIND_CONFIG=${BIND_CONFIG}])
|
||||
+ AC_MSG_RESULT([BIND_CPPFLAGS=${BIND_CPPFLAGS}])
|
||||
+ AC_MSG_RESULT([BIND_LIBS=${BIND_LIBS}])
|
||||
+ AC_MSG_ERROR([Bind libraries are not useable for dhcp])
|
||||
+ fi
|
||||
+ CPPFLAGS="$saved_CPPFLAGS"
|
||||
+ LIBS="$saved_LIBS"
|
||||
+fi
|
||||
+
|
||||
AC_SUBST(BINDDIR)
|
||||
AC_SUBST(BINDSRCDIR)
|
||||
+AC_SUBST(BIND_CPPFLAGS)
|
||||
+AC_SUBST(BIND_LIBS)
|
||||
|
||||
# OpenLDAP support.
|
||||
AC_ARG_WITH(ldap,
|
||||
@@ -795,7 +861,7 @@ fi
|
||||
CFLAGS="$CFLAGS $STD_CWARNINGS"
|
||||
|
||||
# Try to add the bind and dhcp include directories
|
||||
-CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
|
||||
+CFLAGS="$CFLAGS -I\$(top_srcdir)/includes $BIND_CPPFLAGS"
|
||||
|
||||
case "$host" in
|
||||
*-darwin*)
|
||||
diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
|
||||
index ceb0de1..fa20a78 100644
|
||||
--- a/dhcpctl/Makefile.am
|
||||
+++ b/dhcpctl/Makefile.am
|
||||
@@ -1,4 +1,4 @@
|
||||
-BINDLIBDIR = @BINDDIR@/lib
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
bin_PROGRAMS = omshell
|
||||
lib_LIBRARIES = libdhcpctl.a
|
||||
@@ -8,12 +8,10 @@ EXTRA_DIST = $(man_MANS)
|
||||
|
||||
omshell_SOURCES = omshell.c
|
||||
omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
- $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \
|
||||
- $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+ $(BIND_LIBS)
|
||||
|
||||
libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
|
||||
|
||||
cltest_SOURCES = cltest.c
|
||||
cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
- $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \
|
||||
- $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+ $(BIND_LIBS)
|
||||
diff --git a/omapip/Makefile.am b/omapip/Makefile.am
|
||||
index 446a594..b0d2680 100644
|
||||
--- a/omapip/Makefile.am
|
||||
+++ b/omapip/Makefile.am
|
||||
@@ -1,4 +1,4 @@
|
||||
-BINDLIBDIR = @BINDDIR@/lib
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
lib_LIBRARIES = libomapi.a
|
||||
noinst_PROGRAMS = svtest
|
||||
@@ -12,6 +12,5 @@ man_MANS = omapi.3
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
svtest_SOURCES = test.c
|
||||
-svtest_LDADD = libomapi.a $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \
|
||||
- $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+svtest_LDADD = libomapi.a $(BIND_LIBS)
|
||||
|
||||
diff --git a/relay/Makefile.am b/relay/Makefile.am
|
||||
index 3060eca..c9a1cba 100644
|
||||
--- a/relay/Makefile.am
|
||||
+++ b/relay/Makefile.am
|
||||
@@ -1,12 +1,11 @@
|
||||
-BINDLIBDIR = @BINDDIR@/lib
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
|
||||
|
||||
sbin_PROGRAMS = dhcrelay
|
||||
dhcrelay_SOURCES = dhcrelay.c
|
||||
dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
- $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \
|
||||
- $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
|
||||
+ $(BIND_LIBS)
|
||||
man_MANS = dhcrelay.8
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
diff --git a/server/Makefile.am b/server/Makefile.am
|
||||
index 54feedf..30cf2b1 100644
|
||||
--- a/server/Makefile.am
|
||||
+++ b/server/Makefile.am
|
||||
@@ -4,7 +4,7 @@
|
||||
# production code. Sadly, we are not there yet.
|
||||
SUBDIRS = . tests
|
||||
|
||||
-BINDLIBDIR = @BINDDIR@/lib
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
|
||||
|
||||
@@ -16,9 +16,7 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
|
||||
|
||||
dhcpd_CFLAGS = $(LDAP_CFLAGS)
|
||||
dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
- ../dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
|
||||
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
|
||||
- $(BINDLIBDIR)/libisc.a $(LDAP_LIBS)
|
||||
+ ../dhcpctl/libdhcpctl.a $(BIND_LIBS) $(LDAP_LIBS)
|
||||
|
||||
man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
|
||||
index a87c5e7..771de06 100644
|
||||
--- a/server/tests/Makefile.am
|
||||
+++ b/server/tests/Makefile.am
|
||||
@@ -1,9 +1,10 @@
|
||||
SUBDIRS = .
|
||||
|
||||
-BINDLIBDIR = @BINDDIR@/lib
|
||||
+BIND_LIBS = @BIND_LIBS@
|
||||
+
|
||||
|
||||
AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes
|
||||
-AM_CPPFLAGS += -I@BINDDIR@/include -I$(top_srcdir)
|
||||
+AM_CPPFLAGS += $(BIND_CPPFLAGS) -I$(top_srcdir)
|
||||
AM_CPPFLAGS += -DLOCALSTATEDIR='"."'
|
||||
|
||||
EXTRA_DIST = Atffile
|
||||
@@ -20,9 +21,7 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c \
|
||||
../ldap.c ../ldap_casa.c ../dhcpd.c ../leasechain.c
|
||||
|
||||
DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \
|
||||
- $(top_builddir)/dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
|
||||
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
|
||||
- $(BINDLIBDIR)/libisc.a
|
||||
+ $(top_builddir)/dhcpctl/libdhcpctl.a $(BIND_LIBS)
|
||||
|
||||
ATF_TESTS =
|
||||
if HAVE_ATF
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,11 +1,5 @@
|
||||
commit 50c2b3ba8ce030a47b55dd707bb8a6ab20444a05
|
||||
Author: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Thu Feb 21 10:44:06 2019 +0100
|
||||
|
||||
Load leases DB in non-replay mode only
|
||||
|
||||
diff --git a/server/confpars.c b/server/confpars.c
|
||||
index 2743979..6b61964 100644
|
||||
index d79489b..2b1e393 100644
|
||||
--- a/server/confpars.c
|
||||
+++ b/server/confpars.c
|
||||
@@ -134,6 +134,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
|
@ -0,0 +1,231 @@
|
||||
diff -up dhcp-4.3.4/client/dhc6.c.sendDecline dhcp-4.3.4/client/dhc6.c
|
||||
--- dhcp-4.3.4/client/dhc6.c.sendDecline 2016-03-22 14:16:51.000000000 +0100
|
||||
+++ dhcp-4.3.4/client/dhc6.c 2016-05-02 14:51:57.916578401 +0200
|
||||
@@ -115,6 +115,8 @@ void do_select6(void *input);
|
||||
void do_refresh6(void *input);
|
||||
static void do_release6(void *input);
|
||||
static void start_bound(struct client_state *client);
|
||||
+static void start_decline6(struct client_state *client);
|
||||
+static void do_decline6(void *input);
|
||||
static void start_informed(struct client_state *client);
|
||||
void informed_handler(struct packet *packet, struct client_state *client);
|
||||
void bound_handler(struct packet *packet, struct client_state *client);
|
||||
@@ -2314,6 +2316,7 @@ start_release6(struct client_state *clie
|
||||
cancel_timeout(do_select6, client);
|
||||
cancel_timeout(do_refresh6, client);
|
||||
cancel_timeout(do_release6, client);
|
||||
+ cancel_timeout(do_decline6, client);
|
||||
client->state = S_STOPPED;
|
||||
|
||||
/*
|
||||
@@ -2968,6 +2971,7 @@ dhc6_check_reply(struct client_state *cl
|
||||
break;
|
||||
|
||||
case S_STOPPED:
|
||||
+ case S_DECLINED:
|
||||
action = dhc6_stop_action;
|
||||
break;
|
||||
|
||||
@@ -3084,6 +3088,7 @@ dhc6_check_reply(struct client_state *cl
|
||||
break;
|
||||
|
||||
case S_STOPPED:
|
||||
+ case S_DECLINED:
|
||||
/* Nothing critical to do at this stage. */
|
||||
break;
|
||||
|
||||
@@ -4214,17 +4219,23 @@ reply_handler(struct packet *packet, str
|
||||
cancel_timeout(do_select6, client);
|
||||
cancel_timeout(do_refresh6, client);
|
||||
cancel_timeout(do_release6, client);
|
||||
+ cancel_timeout(do_decline6, client);
|
||||
|
||||
/* If this is in response to a Release/Decline, clean up and return. */
|
||||
- if (client->state == S_STOPPED) {
|
||||
- if (client->active_lease == NULL)
|
||||
- return;
|
||||
+ if ((client->state == S_STOPPED) ||
|
||||
+ (client->state == S_DECLINED)) {
|
||||
+
|
||||
+ if (client->active_lease != NULL) {
|
||||
+ dhc6_lease_destroy(&client->active_lease, MDL);
|
||||
+ client->active_lease = NULL;
|
||||
+ /* We should never wait for nothing!? */
|
||||
+ if (stopping_finished())
|
||||
+ exit(0);
|
||||
+ }
|
||||
+
|
||||
+ if (client->state == S_DECLINED)
|
||||
+ start_init6(client);
|
||||
|
||||
- dhc6_lease_destroy(&client->active_lease, MDL);
|
||||
- client->active_lease = NULL;
|
||||
- /* We should never wait for nothing!? */
|
||||
- if (stopping_finished())
|
||||
- exit(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4798,7 +4809,11 @@ start_bound(struct client_state *client)
|
||||
dhc6_marshall_values("new_", client, lease, ia, addr);
|
||||
script_write_requested6(client);
|
||||
|
||||
- script_go(client);
|
||||
+ // when script returns 3, DAD failed
|
||||
+ if (script_go(client) == 3) {
|
||||
+ start_decline6(client);
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* XXX: maybe we should loop on the old values instead? */
|
||||
@@ -4851,6 +4866,149 @@ start_bound(struct client_state *client)
|
||||
dhc6_check_times(client);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Decline addresses.
|
||||
+ */
|
||||
+void
|
||||
+start_decline6(struct client_state *client)
|
||||
+{
|
||||
+ /* Cancel any pending transmissions */
|
||||
+ cancel_timeout(do_confirm6, client);
|
||||
+ cancel_timeout(do_select6, client);
|
||||
+ cancel_timeout(do_refresh6, client);
|
||||
+ cancel_timeout(do_release6, client);
|
||||
+ cancel_timeout(do_decline6, client);
|
||||
+ client->state = S_DECLINED;
|
||||
+
|
||||
+ if (client->active_lease == NULL)
|
||||
+ return;
|
||||
+
|
||||
+ /* Set timers per RFC3315 section 18.1.7. */
|
||||
+ client->IRT = DEC_TIMEOUT * 100;
|
||||
+ client->MRT = 0;
|
||||
+ client->MRC = DEC_MAX_RC;
|
||||
+ client->MRD = 0;
|
||||
+
|
||||
+ dhc6_retrans_init(client);
|
||||
+ client->v6_handler = reply_handler;
|
||||
+
|
||||
+ client->refresh_type = DHCPV6_DECLINE;
|
||||
+ do_decline6(client);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * do_decline6() creates a Decline packet and transmits it.
|
||||
+ */
|
||||
+static void
|
||||
+do_decline6(void *input)
|
||||
+{
|
||||
+ struct client_state *client;
|
||||
+ struct data_string ds;
|
||||
+ struct timeval elapsed, tv;
|
||||
+ int send_ret, added;
|
||||
+
|
||||
+ client = input;
|
||||
+
|
||||
+ if ((client->active_lease == NULL) || !active_prefix(client))
|
||||
+ return;
|
||||
+
|
||||
+ if ((client->MRC != 0) && (client->txcount > client->MRC)) {
|
||||
+ log_info("Max retransmission count exceeded.");
|
||||
+ goto decline_done;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Start_time starts at the first transmission.
|
||||
+ */
|
||||
+ if (client->txcount == 0) {
|
||||
+ client->start_time.tv_sec = cur_tv.tv_sec;
|
||||
+ client->start_time.tv_usec = cur_tv.tv_usec;
|
||||
+ }
|
||||
+
|
||||
+ /* elapsed = cur - start */
|
||||
+ elapsed.tv_sec = cur_tv.tv_sec - client->start_time.tv_sec;
|
||||
+ elapsed.tv_usec = cur_tv.tv_usec - client->start_time.tv_usec;
|
||||
+ if (elapsed.tv_usec < 0) {
|
||||
+ elapsed.tv_sec -= 1;
|
||||
+ elapsed.tv_usec += 1000000;
|
||||
+ }
|
||||
+
|
||||
+ memset(&ds, 0, sizeof(ds));
|
||||
+ if (!buffer_allocate(&ds.buffer, 4, MDL)) {
|
||||
+ log_error("Unable to allocate memory for Decline.");
|
||||
+ goto decline_done;
|
||||
+ }
|
||||
+
|
||||
+ ds.data = ds.buffer->data;
|
||||
+ ds.len = 4;
|
||||
+ ds.buffer->data[0] = DHCPV6_DECLINE;
|
||||
+ memcpy(ds.buffer->data + 1, client->dhcpv6_transaction_id, 3);
|
||||
+
|
||||
+ /* Form an elapsed option. */
|
||||
+ /* Maximum value is 65535 1/100s coded as 0xffff. */
|
||||
+ if ((elapsed.tv_sec < 0) || (elapsed.tv_sec > 655) ||
|
||||
+ ((elapsed.tv_sec == 655) && (elapsed.tv_usec > 350000))) {
|
||||
+ client->elapsed = 0xffff;
|
||||
+ } else {
|
||||
+ client->elapsed = elapsed.tv_sec * 100;
|
||||
+ client->elapsed += elapsed.tv_usec / 10000;
|
||||
+ }
|
||||
+
|
||||
+ client->elapsed = htons(client->elapsed);
|
||||
+
|
||||
+ log_debug("XMT: Forming Decline.");
|
||||
+ make_client6_options(client, &client->sent_options,
|
||||
+ client->active_lease, DHCPV6_DECLINE);
|
||||
+ dhcpv6_universe.encapsulate(&ds, NULL, NULL, client, NULL,
|
||||
+ client->sent_options, &global_scope,
|
||||
+ &dhcpv6_universe);
|
||||
+
|
||||
+ /* Append IA's (but don't release temporary addresses). */
|
||||
+ if (wanted_ia_na &&
|
||||
+ dhc6_add_ia_na(client, &ds, client->active_lease,
|
||||
+ DHCPV6_DECLINE, 0, &added) != ISC_R_SUCCESS) {
|
||||
+ data_string_forget(&ds, MDL);
|
||||
+ goto decline_done;
|
||||
+ }
|
||||
+ if (wanted_ia_pd &&
|
||||
+ dhc6_add_ia_pd(client, &ds, client->active_lease,
|
||||
+ DHCPV6_DECLINE, 0, &added) != ISC_R_SUCCESS) {
|
||||
+ data_string_forget(&ds, MDL);
|
||||
+ goto decline_done;
|
||||
+ }
|
||||
+
|
||||
+ /* Transmit and wait. */
|
||||
+ log_info("XMT: Decline on %s, interval %ld0ms.",
|
||||
+ client->name ? client->name : client->interface->name,
|
||||
+ (long int)client->RT);
|
||||
+
|
||||
+ send_ret = send_packet6(client->interface, ds.data, ds.len,
|
||||
+ &DHCPv6DestAddr);
|
||||
+ if (send_ret != ds.len) {
|
||||
+ log_error("dhc6: sendpacket6() sent %d of %d bytes",
|
||||
+ send_ret, ds.len);
|
||||
+ }
|
||||
+
|
||||
+ data_string_forget(&ds, MDL);
|
||||
+
|
||||
+ /* Wait RT */
|
||||
+ tv.tv_sec = cur_tv.tv_sec + client->RT / 100;
|
||||
+ tv.tv_usec = cur_tv.tv_usec + (client->RT % 100) * 10000;
|
||||
+ if (tv.tv_usec >= 1000000) {
|
||||
+ tv.tv_sec += 1;
|
||||
+ tv.tv_usec -= 1000000;
|
||||
+ }
|
||||
+ add_timeout(&tv, do_decline6, client, NULL, NULL);
|
||||
+ dhc6_retrans_advance(client);
|
||||
+ return;
|
||||
+
|
||||
+decline_done:
|
||||
+ dhc6_lease_destroy(&client->active_lease, MDL);
|
||||
+ client->active_lease = NULL;
|
||||
+ start_init6(client);
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
/* While bound, ignore packets. In the future we'll want to answer
|
||||
* Reconfigure-Request messages and the like.
|
||||
*/
|
@ -0,0 +1,149 @@
|
||||
diff --git a/client/Makefile.am b/client/Makefile.am
|
||||
index b85f5d2..b1ecf82 100644
|
||||
--- a/client/Makefile.am
|
||||
+++ b/client/Makefile.am
|
||||
@@ -15,6 +15,6 @@ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
|
||||
scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
|
||||
scripts/netbsd scripts/nextstep scripts/openbsd \
|
||||
scripts/solaris scripts/openwrt
|
||||
-dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(BIND_LIBS)
|
||||
+dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la $(BIND_LIBS)
|
||||
man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
|
||||
index 196aa44..1ccaa05 100644
|
||||
--- a/common/tests/Makefile.am
|
||||
+++ b/common/tests/Makefile.am
|
||||
@@ -15,22 +15,22 @@ ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest
|
||||
alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
alloc_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
alloc_unittest_LDADD += ../libdhcp.a \
|
||||
- ../../omapip/libomapi.a $(BIND_LIBS)
|
||||
+ ../../omapip/libomapi.la $(BIND_LIBS)
|
||||
|
||||
dns_unittest_SOURCES = dns_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
dns_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
dns_unittest_LDADD += ../libdhcp.a \
|
||||
- ../../omapip/libomapi.a $(BIND_LIBS)
|
||||
+ ../../omapip/libomapi.la $(BIND_LIBS)
|
||||
|
||||
misc_unittest_SOURCES = misc_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
misc_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
misc_unittest_LDADD += ../libdhcp.a \
|
||||
- ../../omapip/libomapi.a $(BIND_LIBS)
|
||||
+ ../../omapip/libomapi.la $(BIND_LIBS)
|
||||
|
||||
ns_name_unittest_SOURCES = ns_name_test.c $(top_srcdir)/tests/t_api_dhcp.c
|
||||
ns_name_unittest_LDADD = $(ATF_LDFLAGS)
|
||||
ns_name_unittest_LDADD += ../libdhcp.a \
|
||||
- ../../omapip/libomapi.a $(BIND_LIBS)
|
||||
+ ../../omapip/libomapi.la $(BIND_LIBS)
|
||||
|
||||
check: $(ATF_TESTS)
|
||||
@if test $(top_srcdir) != ${top_builddir}; then \
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f594cfa..adc98a8 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -47,7 +47,8 @@ AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")
|
||||
# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
-AC_PROG_RANLIB
|
||||
+# Use libtool to simplify building of shared libraries
|
||||
+AC_PROG_LIBTOOL
|
||||
|
||||
AC_PATH_PROG(AR, ar)
|
||||
AC_SUBST(AR)
|
||||
diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
|
||||
index fa20a78..dd016e4 100644
|
||||
--- a/dhcpctl/Makefile.am
|
||||
+++ b/dhcpctl/Makefile.am
|
||||
@@ -1,17 +1,17 @@
|
||||
BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
bin_PROGRAMS = omshell
|
||||
-lib_LIBRARIES = libdhcpctl.a
|
||||
+lib_LTLIBRARIES = libdhcpctl.la
|
||||
noinst_PROGRAMS = cltest
|
||||
man_MANS = omshell.1 dhcpctl.3
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
omshell_SOURCES = omshell.c
|
||||
-omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
+omshell_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \
|
||||
$(BIND_LIBS)
|
||||
|
||||
-libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
|
||||
+libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c
|
||||
|
||||
cltest_SOURCES = cltest.c
|
||||
-cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
+cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \
|
||||
$(BIND_LIBS)
|
||||
diff --git a/omapip/Makefile.am b/omapip/Makefile.am
|
||||
index b0d2680..265bcef 100644
|
||||
--- a/omapip/Makefile.am
|
||||
+++ b/omapip/Makefile.am
|
||||
@@ -1,9 +1,9 @@
|
||||
BIND_LIBS = @BIND_LIBS@
|
||||
|
||||
-lib_LIBRARIES = libomapi.a
|
||||
+lib_LTLIBRARIES = libomapi.la
|
||||
noinst_PROGRAMS = svtest
|
||||
|
||||
-libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
|
||||
+libomapi_la_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
|
||||
errwarn.c listener.c dispatch.c generic.c support.c \
|
||||
handle.c message.c convert.c hash.c auth.c inet_addr.c \
|
||||
array.c trace.c toisc.c iscprint.c isclib.c
|
||||
@@ -12,5 +12,5 @@ man_MANS = omapi.3
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
svtest_SOURCES = test.c
|
||||
-svtest_LDADD = libomapi.a $(BIND_LIBS)
|
||||
+svtest_LDADD = libomapi.la $(BIND_LIBS)
|
||||
|
||||
diff --git a/relay/Makefile.am b/relay/Makefile.am
|
||||
index c9a1cba..316a524 100644
|
||||
--- a/relay/Makefile.am
|
||||
+++ b/relay/Makefile.am
|
||||
@@ -4,7 +4,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
|
||||
|
||||
sbin_PROGRAMS = dhcrelay
|
||||
dhcrelay_SOURCES = dhcrelay.c
|
||||
-dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
+dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \
|
||||
$(BIND_LIBS)
|
||||
man_MANS = dhcrelay.8
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
diff --git a/server/Makefile.am b/server/Makefile.am
|
||||
index 30cf2b1..f56f310 100644
|
||||
--- a/server/Makefile.am
|
||||
+++ b/server/Makefile.am
|
||||
@@ -15,8 +15,8 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
|
||||
dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c
|
||||
|
||||
dhcpd_CFLAGS = $(LDAP_CFLAGS)
|
||||
-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
|
||||
- ../dhcpctl/libdhcpctl.a $(BIND_LIBS) $(LDAP_LIBS)
|
||||
+dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \
|
||||
+ ../dhcpctl/libdhcpctl.la $(BIND_LIBS) $(LDAP_LIBS)
|
||||
|
||||
man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
|
||||
index 771de06..8d8a2c1 100644
|
||||
--- a/server/tests/Makefile.am
|
||||
+++ b/server/tests/Makefile.am
|
||||
@@ -20,8 +20,8 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c \
|
||||
../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c \
|
||||
../ldap.c ../ldap_casa.c ../dhcpd.c ../leasechain.c
|
||||
|
||||
-DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \
|
||||
- $(top_builddir)/dhcpctl/libdhcpctl.a $(BIND_LIBS)
|
||||
+DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.la \
|
||||
+ $(top_builddir)/dhcpctl/libdhcpctl.la $(BIND_LIBS)
|
||||
|
||||
ATF_TESTS =
|
||||
if HAVE_ATF
|
@ -0,0 +1,13 @@
|
||||
diff -up dhcp-4.3.4/client/dhclient.c.stateless-DUID-LLT dhcp-4.3.4/client/dhclient.c
|
||||
--- dhcp-4.3.4/client/dhclient.c.stateless-DUID-LLT 2016-04-29 13:13:50.467360008 +0200
|
||||
+++ dhcp-4.3.4/client/dhclient.c 2016-04-29 13:14:53.389375428 +0200
|
||||
@@ -1317,6 +1317,9 @@ void run_stateless(int exit_mode, u_int1
|
||||
data_string_forget(&default_duid, MDL);
|
||||
|
||||
form_duid(&default_duid, MDL);
|
||||
+ if (form_duid(&default_duid, MDL) == ISC_R_SUCCESS &&
|
||||
+ duid_type == DUID_LLT)
|
||||
+ write_duid(&default_duid);
|
||||
}
|
||||
|
||||
#ifdef DHCP4o6
|
@ -1,3 +0,0 @@
|
||||
#Type Name ID GECOS Home directory Shell
|
||||
g dhcpd 177
|
||||
u dhcpd 177 "DHCP server" / /sbin/nologin
|
@ -1,15 +0,0 @@
|
||||
diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c
|
||||
index c4ee5ba..1c6531a 100644
|
||||
--- a/relay/dhcrelay.c
|
||||
+++ b/relay/dhcrelay.c
|
||||
@@ -843,8 +843,8 @@ main(int argc, char **argv) {
|
||||
#ifdef HAVE_LIBCAP_NG
|
||||
/* Drop all capabilities */
|
||||
if (!keep_capabilities) {
|
||||
- capng_clear(CAPNG_SELECT_BOTH);
|
||||
- capng_apply(CAPNG_SELECT_BOTH);
|
||||
+ capng_clear(CAPNG_SELECT_CAPS);
|
||||
+ capng_apply(CAPNG_SELECT_CAPS);
|
||||
log_info ("Dropped all capabilities.");
|
||||
}
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue