From af708bb8bed751331193e7bd4df9df715b61a51f Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Jul 14 2017 14:13:47 +0000 Subject: New version 4.3.6b1 --- diff --git a/.gitignore b/.gitignore index 133ca50..7790a71 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ /dhcp-4.3.4.tar.gz /dhcp-4.3.5b1.tar.gz /dhcp-4.3.5.tar.gz +/dhcp-4.3.6b1.tar.gz diff --git a/dhcp-4.3.5.tar.gz.asc b/dhcp-4.3.5.tar.gz.asc deleted file mode 100644 index fa3a83e..0000000 --- a/dhcp-4.3.5.tar.gz.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.11 (GNU/Linux) - -iQEcBAABAgAGBQJX8jrBAAoJEG+m68mRGkwCczcH/1lMdlvf2RX+IfNraDTXWmY1 -+MGk51H7aIJDRDFhiLA1f1ht1hIXJB0gnaOdJxLcqQGUiHPQfVZidDz2XxAjr7S2 -VvV6mfHxO1+oPsaFzCEItDqHk/LJcBDgKWC2cvabNfi5Nyq8rR+Zjn0i509DYFBR -cJYzau7Smse8ZVpUrsdLOtKgNznVPioowqCooiOlzZfYNfKOdwk4z6U8vglLhRL4 -xpfbg373Z78dExeNPqJ97c/tUg2YCnuZGvLfwvI+2Bzrp63TbAnJYB3CnyCj+fS2 -iSH7WACNSqRQoEWxE+vi9kTY0GGVFaonPZSRMT1DKFhBge4TdMCm2STIIOJiPFw= -=xG2q ------END PGP SIGNATURE----- diff --git a/dhcp-IPoIB-log-id.patch b/dhcp-IPoIB-log-id.patch index 97e9dd5..e0369bb 100644 --- a/dhcp-IPoIB-log-id.patch +++ b/dhcp-IPoIB-log-id.patch @@ -1,9 +1,8 @@ -diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c ---- dhcp-4.3.4/server/dhcp.c.IPoIB-log-id 2016-04-29 12:52:14.285061620 +0200 -+++ dhcp-4.3.4/server/dhcp.c 2016-04-29 12:53:59.535088020 +0200 -@@ -85,6 +85,42 @@ const int dhcp_type_name_max = ((sizeof - # define send_packet trace_packet_send - #endif +--- 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; @@ -44,7 +43,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c void dhcp (struct packet *packet) { int ms_nulltp = 0; -@@ -127,9 +163,7 @@ dhcp (struct packet *packet) { +@@ -129,9 +165,7 @@ log_info("%s from %s via %s: %s", s, (packet->raw->htype @@ -55,7 +54,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c : ""), packet->raw->giaddr.s_addr ? inet_ntoa(packet->raw->giaddr) -@@ -326,9 +360,7 @@ void dhcpdiscover (packet, ms_nulltp) +@@ -328,9 +362,7 @@ #endif snprintf (msgbuf, sizeof msgbuf, "DHCPDISCOVER from %s %s%s%svia %s", (packet -> raw -> htype @@ -66,7 +65,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c : (lease ? print_hex_1(lease->uid_len, lease->uid, 60) : "")), -@@ -540,9 +572,7 @@ void dhcprequest (packet, ms_nulltp, ip_ +@@ -542,9 +574,7 @@ "DHCPREQUEST for %s%s from %s %s%s%svia %s", piaddr (cip), smbuf, (packet -> raw -> htype @@ -77,7 +76,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c : (lease ? print_hex_1(lease->uid_len, lease->uid, 60) : "")), -@@ -783,9 +813,7 @@ void dhcprelease (packet, ms_nulltp) +@@ -785,9 +815,7 @@ if ((oc = lookup_option (&dhcp_universe, packet -> options, DHO_DHCP_REQUESTED_ADDRESS))) { log_info ("DHCPRELEASE from %s specified requested-address.", @@ -88,7 +87,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c } oc = lookup_option (&dhcp_universe, packet -> options, -@@ -877,9 +905,7 @@ void dhcprelease (packet, ms_nulltp) +@@ -879,9 +907,7 @@ "DHCPRELEASE of %s from %s %s%s%svia %s (%sfound)", cstr, (packet -> raw -> htype @@ -99,7 +98,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c : (lease ? print_hex_1(lease->uid_len, lease->uid, 60) : "")), -@@ -984,9 +1010,7 @@ void dhcpdecline (packet, ms_nulltp) +@@ -986,9 +1012,7 @@ "DHCPDECLINE of %s from %s %s%s%svia %s", piaddr (cip), (packet -> raw -> htype @@ -110,7 +109,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c : (lease ? print_hex_1(lease->uid_len, lease->uid, 60) : "")), -@@ -1683,8 +1707,7 @@ void dhcpinform (packet, ms_nulltp) +@@ -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) ? @@ -120,7 +119,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c ""); log_info("%s %s", msgbuf, gip.len ? piaddr(gip) : packet->interface->name); -@@ -1862,9 +1885,7 @@ void nak_lease (packet, cip, network_gro +@@ -1886,9 +1909,7 @@ #endif log_info ("DHCPNAK on %s to %s via %s", piaddr (*cip), @@ -131,7 +130,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c packet -> raw -> giaddr.s_addr ? inet_ntoa (packet -> raw -> giaddr) : packet -> interface -> name); -@@ -3859,7 +3880,7 @@ void dhcp_reply (lease) +@@ -3897,7 +3918,7 @@ ? (state -> offer == DHCPACK ? "DHCPACK" : "DHCPOFFER") : "BOOTREPLY"), piaddr (lease -> ip_addr), @@ -140,7 +139,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c ? print_hw_addr (lease -> hardware_addr.hbuf [0], lease -> hardware_addr.hlen - 1, &lease -> hardware_addr.hbuf [1]) -@@ -4408,10 +4429,7 @@ int find_lease (struct lease **lp, +@@ -4450,10 +4471,7 @@ if (uid_lease) { if (uid_lease->binding_state == FTS_ACTIVE) { log_error ("client %s has duplicate%s on %s", @@ -152,7 +151,7 @@ diff -up dhcp-4.3.4/server/dhcp.c.IPoIB-log-id dhcp-4.3.4/server/dhcp.c " leases", (ip_lease -> subnet -> shared_network -> name)); -@@ -4578,9 +4596,7 @@ int find_lease (struct lease **lp, +@@ -4620,9 +4638,7 @@ log_error("uid lease %s for client %s is duplicate " "on %s", piaddr(uid_lease->ip_addr), diff --git a/dhcp-capability.patch b/dhcp-capability.patch index 4572c34..b689f7d 100644 --- a/dhcp-capability.patch +++ b/dhcp-capability.patch @@ -11,9 +11,9 @@ diff -up dhcp-4.3.4/client/dhclient.8.capability dhcp-4.3.4/client/dhclient.8 .B -B ] [ -@@ -318,6 +321,32 @@ has been added or removed, so that the c +@@ -318,6 +321,32 @@ program can then be used to notify the c + has been added or removed, so that the client can attempt to configure an IP address on that interface. - .TP +.BI \-nc +Do not drop capabilities. @@ -41,9 +41,9 @@ diff -up dhcp-4.3.4/client/dhclient.8.capability dhcp-4.3.4/client/dhclient.8 +was not compiled with libcap-ng support. + +.TP - .BI \-B - Set the BOOTP broadcast flag in request packets so servers will always - broadcast replies. + .BI \-n + Do not configure any interfaces. This is most likely to be useful in + combination with the diff -up dhcp-4.3.4/client/dhclient.c.capability dhcp-4.3.4/client/dhclient.c --- dhcp-4.3.4/client/dhclient.c.capability 2016-04-29 12:19:40.691129307 +0200 +++ dhcp-4.3.4/client/dhclient.c 2016-04-29 12:21:07.620091930 +0200 diff --git a/dhcp-dhclient-ddns_lazy.patch b/dhcp-dhclient-ddns_lazy.patch deleted file mode 100644 index 6c8d031..0000000 --- a/dhcp-dhclient-ddns_lazy.patch +++ /dev/null @@ -1,136 +0,0 @@ -diff --git a/common/dns.c b/common/dns.c -index 0f8be80..37878bc 100644 ---- a/common/dns.c -+++ b/common/dns.c -@@ -2132,6 +2132,41 @@ void ddns_interlude(isc_task_t *taskp, - } - - /* -+ * Moved here from omapip/isclib.c, function dhcp_context_create. -+ * Create dnsclient only before the first use. -+ */ -+static isc_result_t -+dns_client_lazy() { -+ isc_result_t result; -+ if (dhcp_gbl_ctx.dnsclient == NULL){ -+ result = dns_client_createx2(dhcp_gbl_ctx.mctx, -+ dhcp_gbl_ctx.actx, -+ dhcp_gbl_ctx.taskmgr, -+ dhcp_gbl_ctx.socketmgr, -+ dhcp_gbl_ctx.timermgr, -+ 0, -+ &dhcp_gbl_ctx.dnsclient, -+ dhcp_gbl_ctx.local4_ptr, -+ dhcp_gbl_ctx.local6_ptr); -+ if (result != ISC_R_SUCCESS) -+ return result; -+ /* -+ * If we can't set up the servers we may not be able to -+ * do DDNS but we should continue to try and perform -+ * our basic functions and let the user sort it out. -+ */ -+ result = dhcp_dns_client_setservers(); -+ if (result != ISC_R_SUCCESS) { -+ log_error("Unable to set resolver from resolv.conf; " -+ "startup continuing but DDNS support " -+ "may be affected"); -+ } -+ }; -+ return ISC_R_SUCCESS; -+} -+ -+ -+/* - * This routine does the generic work for sending a ddns message to - * modify the forward record (A or AAAA) and calls one of a set of - * routines to build the specific message. -@@ -2154,6 +2189,10 @@ ddns_modify_fwd(dhcp_ddns_cb_t *ddns_cb, const char *file, int line) - /* Get a pointer to the clientname to make things easier. */ - clientname = (unsigned char *)ddns_cb->fwd_name.data; - -+ result = dns_client_lazy(); -+ if (result != ISC_R_SUCCESS) -+ return result; -+ - /* Extract and validate the type of the address. */ - if (ddns_cb->address.len == 4) { - ddns_cb->address_type = dns_rdatatype_a; -@@ -2359,6 +2398,10 @@ ddns_modify_ptr(dhcp_ddns_cb_t *ddns_cb, const char *file, int line) - unsigned char buf[256]; - int buflen; - -+ result = dns_client_lazy(); -+ if (result != ISC_R_SUCCESS) -+ return result; -+ - /* - * Try to lookup the zone in the zone cache. As with the forward - * case it's okay if we don't have one, the DNS code will try to -diff --git a/includes/omapip/isclib.h b/includes/omapip/isclib.h -index caa388a..7f2719b 100644 ---- a/includes/omapip/isclib.h -+++ b/includes/omapip/isclib.h -@@ -98,6 +98,8 @@ typedef struct dhcp_context { - isc_timermgr_t *timermgr; - #if defined (NSUPDATE) - dns_client_t *dnsclient; -+ isc_sockaddr_t *local4_ptr; -+ isc_sockaddr_t *local6_ptr; - #endif - } dhcp_context_t; - -diff --git a/omapip/isclib.c b/omapip/isclib.c -index 13f0d3e..36b399d 100644 ---- a/omapip/isclib.c -+++ b/omapip/isclib.c -@@ -220,40 +220,22 @@ dhcp_context_create(int flags, - } - - #if defined (NSUPDATE) -+ /* -+ * Setting addresses only. -+ * All real work will be done later on if needed to avoid listening -+ * on ddns port if client/server was compiled with ddns support -+ * but not using it. -+ */ - if ((flags & DHCP_CONTEXT_POST_DB) != 0) { -- isc_sockaddr_t localaddr4, *localaddr4_ptr = NULL; -- isc_sockaddr_t localaddr6, *localaddr6_ptr = NULL; -+ isc_sockaddr_t localaddr4; -+ isc_sockaddr_t localaddr6; - if (local4 != NULL) { - isc_sockaddr_fromin(&localaddr4, local4, 0); -- localaddr4_ptr = &localaddr4; -+ dhcp_gbl_ctx.local4_ptr = &localaddr4; - } - if (local6 != NULL) { - isc_sockaddr_fromin6(&localaddr6, local6, 0); -- localaddr6_ptr = &localaddr6; -- } -- -- result = dns_client_createx2(dhcp_gbl_ctx.mctx, -- dhcp_gbl_ctx.actx, -- dhcp_gbl_ctx.taskmgr, -- dhcp_gbl_ctx.socketmgr, -- dhcp_gbl_ctx.timermgr, -- 0, -- &dhcp_gbl_ctx.dnsclient, -- localaddr4_ptr, -- localaddr6_ptr); -- if (result != ISC_R_SUCCESS) -- goto cleanup; -- -- /* -- * If we can't set up the servers we may not be able to -- * do DDNS but we should continue to try and perform -- * our basic functions and let the user sort it out. -- */ -- result = dhcp_dns_client_setservers(); -- if (result != ISC_R_SUCCESS) { -- log_error("Unable to set resolver from resolv.conf; " -- "startup continuing but DDNS support " -- "may be affected"); -+ dhcp_gbl_ctx.local6_ptr = &localaddr6; - } - } - #endif diff --git a/dhcp-dhclient-decline-backoff.patch b/dhcp-dhclient-decline-backoff.patch index 645f931..1fc1c12 100644 --- a/dhcp-dhclient-decline-backoff.patch +++ b/dhcp-dhclient-decline-backoff.patch @@ -32,8 +32,8 @@ diff -up dhcp-4.3.4/client/dhclient.c.backoff dhcp-4.3.4/client/dhclient.c } /* -@@ -1734,6 +1745,7 @@ void bind_lease (client) - "try (declined). Exiting."); +@@ -1734,5 +1745,6 @@ void bind_lease (client) +#endif exit(2); } else { + client -> state = S_DECLINED; diff --git a/dhcp-dhclient-options.patch b/dhcp-dhclient-options.patch index 8f0dfe9..806ac63 100644 --- a/dhcp-dhclient-options.patch +++ b/dhcp-dhclient-options.patch @@ -1,6 +1,7 @@ -diff -up dhcp-4.3.4/client/clparse.c.options dhcp-4.3.4/client/clparse.c ---- dhcp-4.3.4/client/clparse.c.options 2016-03-22 14:16:51.000000000 +0100 -+++ dhcp-4.3.4/client/clparse.c 2016-04-29 12:06:13.485470579 +0200 +diff --git a/client/clparse.c b/client/clparse.c +index 03190c3..2033427 100644 +--- a/client/clparse.c ++++ b/client/clparse.c @@ -189,6 +189,7 @@ isc_result_t read_client_conf () /* Requested lease time, used by DHCPv6 (DHCPv4 uses the option cache) */ @@ -19,7 +20,7 @@ diff -up dhcp-4.3.4/client/clparse.c.options dhcp-4.3.4/client/clparse.c void parse_client_statement (cfile, ip, config) struct parse *cfile; -@@ -817,6 +819,12 @@ void parse_client_statement (cfile, ip, +@@ -817,6 +819,12 @@ void parse_client_statement (cfile, ip, config) parse_lease_id_format(cfile); break; @@ -32,10 +33,11 @@ diff -up dhcp-4.3.4/client/clparse.c.options dhcp-4.3.4/client/clparse.c default: lose = 0; -diff -up dhcp-4.3.4/client/dhclient.8.options dhcp-4.3.4/client/dhclient.8 ---- dhcp-4.3.4/client/dhclient.8.options 2016-03-22 14:16:51.000000000 +0100 -+++ dhcp-4.3.4/client/dhclient.8 2016-04-29 11:59:50.446590077 +0200 -@@ -134,6 +134,33 @@ dhclient - Dynamic Host Configuration Pr +diff --git a/client/dhclient.8 b/client/dhclient.8 +index 24f8f12..aa2238d 100644 +--- a/client/dhclient.8 ++++ b/client/dhclient.8 +@@ -134,6 +134,33 @@ dhclient - Dynamic Host Configuration Protocol Client .B -w ] [ @@ -66,82 +68,13 @@ diff -up dhcp-4.3.4/client/dhclient.8.options dhcp-4.3.4/client/dhclient.8 +.I timeout +] +[ - .B -v + .B --dad-wait-time + .I seconds ] - [ -@@ -289,6 +316,69 @@ not to exit when it doesn't find any suc - program can then be used to notify the client when a network interface - has been added or removed, so that the client can attempt to configure an IP - address on that interface. -+ -+.TP -+.BI \-B -+Set the BOOTP broadcast flag in request packets so servers will always -+broadcast replies. -+ -+.TP -+.BI \-C\ -+Specify the dhcp-client-identifier option to send to the DHCP server. -+ -+.TP -+.BI \-H\ -+Specify the host-name option to send to the DHCP server. The host-name -+string only contains the client's hostname prefix, to which the server will -+append the ddns-domainname or domain-name options, if any, to derive the -+fully qualified domain name of the client. The -+.B -H -+option cannot be used with the -+.B -F -+option. -+ -+.TP -+.BI \-F\ -+Specify the fqdn.fqdn option to send to the DHCP server. This option cannot -+be used with the -+.B -H -+option. The fqdn.fqdn option must specify the complete domain name of the -+client host, which the server may use for dynamic DNS updates. -+ -+.TP -+.BI \-V\ -+Specify the vendor-class-identifier option to send to the DHCP server. -+ -+.TP -+.BI \--request-options\