SHA256
1
0
forked from pool/dhcp

For complete changelog, please read the RELNOTES file shipped

along with this package or online at:
- Replaced hostname patch with a dhcpv6 and fqdn aware variant:
  [- 0006-dhcp-4.2.5-dhclient-send-hostname-rml.patch,
   + 0006-dhcp-4.3.2-dhclient-send-hostname-or-fqdn.patch]
- Adjusted patch numbers in the spec file:
  [- 0008-dhcp-4.1.1-P1-lpf-bind-msg-fix.patch,
   - 0010-dhcp-4.2.2-dhclient-option-checks.patch,
   - 0011-dhcp-4.2.6-close-on-exec.patch,
   - 0012-dhcp-4.2.2-quiet-dhclient.patch,
   - 0014-Fixed-linux-interface-discovery-using-getifaddrs.patch,
   - 0020-dhcp-4.2.x-chown-server-leases.bnc868253.patch,
   - 0024-dhcp-4.2.x-dhcpv6-decline-on-DAD-failure.872609.patch,
   + 0008-dhcp-4.2.2-dhclient-option-checks.patch,
   + 0009-dhcp-4.2.6-close-on-exec.patch,
   + 0010-dhcp-4.2.2-quiet-dhclient.patch,
   + 0011-Fixed-linux-interface-discovery-using-getifaddrs.patch,
   + 0012-dhcp-4.2.x-chown-server-leases.bnc868253.patch,
   + 0013-dhcp-4.2.x-dhcpv6-decline-on-DAD-failure.872609.patch]
- Fixed to not pass DHCPv6 address lifetimes a positive (unsigned
  32bit) integers to scripts and properly format timestamps as long
  to not break them on 64bit architectures (bsc#926159).
  [+ 0014-dhclient6-unsigned-lifetimes-for-script-bsc-926159.patch]
- dhclient: expose next-server DHCPv4 option to script (bsc#928390)
  [+ 0015-Expose-next-server-DHCPv4-option-to-dhclient-script.patch]
- Replaced infiniband support patch with fixed variant (bsc#910984):
  [- 0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch,
   - 0018-dhcp-4.2.6-improved-xid.patch,
   + 0016-infiniband-support.patch]
- Moved dhcp-devel package include files and static libraries

OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=154
This commit is contained in:
Marius Tomaschewski 2015-09-14 15:35:16 +00:00 committed by Git OBS Bridge
parent 82338f935b
commit d2a944c552
19 changed files with 334 additions and 391 deletions

View File

@ -1,44 +0,0 @@
From b6ba495cc0b6f578a5cc444af39cab424f63d996 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 18 Aug 2011 09:50:30 +0200
Subject: [PATCH] dhcp-4.1.1-default-paths
---
includes/dhcpd.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
index b0f73fb..5830bdb 100644
--- a/includes/dhcpd.h
+++ b/includes/dhcpd.h
@@ -1420,11 +1420,11 @@ typedef unsigned char option_mask [16];
#endif /* DEBUG */
#ifndef _PATH_DHCPD_DB
-#define _PATH_DHCPD_DB LOCALSTATEDIR"/db/dhcpd.leases"
+#define _PATH_DHCPD_DB LOCALSTATEDIR"/lib/dhcp/db/dhcpd.leases"
#endif
#ifndef _PATH_DHCPD6_DB
-#define _PATH_DHCPD6_DB LOCALSTATEDIR"/db/dhcpd6.leases"
+#define _PATH_DHCPD6_DB LOCALSTATEDIR"/lib/dhcp6/db/dhcpd6.leases"
#endif
#ifndef _PATH_DHCPD_PID
@@ -1454,11 +1454,11 @@ typedef unsigned char option_mask [16];
#endif
#ifndef _PATH_DHCLIENT_DB
-#define _PATH_DHCLIENT_DB LOCALSTATEDIR"/db/dhclient.leases"
+#define _PATH_DHCLIENT_DB LOCALSTATEDIR"/lib/dhcp/dhclient.leases"
#endif
#ifndef _PATH_DHCLIENT6_DB
-#define _PATH_DHCLIENT6_DB LOCALSTATEDIR"/db/dhclient6.leases"
+#define _PATH_DHCLIENT6_DB LOCALSTATEDIR"/lib/dhcp6/dhclient6.leases"
#endif
#ifndef _PATH_RESOLV_CONF
--
1.8.4

View File

@ -1,75 +0,0 @@
From 1561b8cb9bacabc5e6064b84ba7a187bfb97d0ad Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 18 Aug 2011 09:53:00 +0200
Subject: [PATCH] dhcp-4.1.1-paranoia
---
server/dhcpd.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/server/dhcpd.c b/server/dhcpd.c
index 7dc7dd2..b4c1bef 100644
--- a/server/dhcpd.c
+++ b/server/dhcpd.c
@@ -207,7 +207,11 @@ static void omapi_listener_start (void *foo)
#if defined (PARANOIA)
/* to be used in one of two possible scenarios */
static void setup_chroot (char *chroot_dir) {
- if (geteuid())
+ /*
+ ** getuid() instead of geteuid(), see
+ ** comment by thomas@suse.de bellow
+ */
+ if (getuid())
log_fatal ("you must be root to use chroot");
if (chroot(chroot_dir)) {
@@ -413,7 +417,7 @@ main(int argc, char **argv) {
log_fatal ("Insufficient memory to %s %s: %s",
"record interface", argv [i],
isc_result_totext (result));
- strcpy (tmp -> name, argv [i]);
+ strncpy (tmp -> name, argv [i], sizeof(tmp->name)-1);
if (interfaces) {
interface_reference (&tmp -> next,
interfaces, MDL);
@@ -499,7 +503,15 @@ main(int argc, char **argv) {
if (set_user) {
struct passwd *tmp_pwd;
- if (geteuid())
+ /*
+ ** I query for the real UID and not for the effective UID
+ ** just to force the user to run this server as root and
+ ** not setting it suid. It should be a paranoia patch and
+ ** not a teletubbie patch. *eg*
+ ** Note: That the user is still able to set it suid! *zitter*
+ ** thomas@suse.de
+ */
+ if (getuid())
log_fatal ("you must be root to set user");
if (!(tmp_pwd = getpwnam(set_user)))
@@ -517,7 +529,10 @@ main(int argc, char **argv) {
#define group real_group
struct group *tmp_grp;
- if (geteuid())
+ /*
+ ** getuid() instead of geteuid(), see above
+ */
+ if (getuid())
log_fatal ("you must be root to set group");
if (!(tmp_grp = getgrnam(set_group)))
@@ -771,6 +786,7 @@ main(int argc, char **argv) {
/* change uid to the specified one */
if (set_gid) {
+ /* setgroups is done, OK */
if (setgroups (0, (void *)0))
log_fatal ("setgroups: %m");
if (setgid (set_gid))
--
1.8.4

View File

@ -1,41 +0,0 @@
From 3c393c65c158048f55017e48aedcc304c9ebd075 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 18 Aug 2011 10:01:04 +0200
Subject: [PATCH] dhcp-4.2.2-man-includes
---
dhcpctl/dhcpctl.3 | 4 ++--
omapip/omapi.3 | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dhcpctl/dhcpctl.3 b/dhcpctl/dhcpctl.3
index ae42a71..d699f4a 100644
--- a/dhcpctl/dhcpctl.3
+++ b/dhcpctl/dhcpctl.3
@@ -430,8 +430,8 @@ that most error checking has been omitted for brevity.
#include <netinet/in.h>
#include <arpa/inet.h>
-#include "omapip/result.h"
-#include "dhcpctl.h"
+#include <omapip/result.h>
+#include <dhcpctl/dhcpctl.h>
int main (int argc, char **argv) {
dhcpctl_data_string ipaddrstring = NULL;
diff --git a/omapip/omapi.3 b/omapip/omapi.3
index 8fa8105..a616fd3 100644
--- a/omapip/omapi.3
+++ b/omapip/omapi.3
@@ -88,7 +88,7 @@ the lease ends.
#include <stdio.h>
#include <netinet/in.h>
- #include <isc/result.h>
+ #include <omapip/result.h>
#include <dhcpctl/dhcpctl.h>
int main (int argc, char **argv) {
--
1.8.4

View File

@ -1,37 +0,0 @@
From 70f2683580a88180238804546dd24a6a41427282 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 18 Aug 2011 10:06:01 +0200
Subject: [PATCH] dhcp-4.1.1-tmpfile
Signed-off-by: Marius Tomaschewski <mt@suse.de>
diff --git a/server/db.c b/server/db.c
index 5238ed8..0c642ad 100644
--- a/server/db.c
+++ b/server/db.c
@@ -1116,15 +1116,19 @@ int new_lease_file ()
* either by malice or ignorance, we panic, since the potential
* for havoc is high.
*/
- if (snprintf (newfname, sizeof newfname, "%s.%d",
- path_dhcpd_db, (int)t) >= sizeof newfname)
+ if (snprintf (newfname, sizeof newfname, "%s.XXXXXX",
+ path_dhcpd_db) >= sizeof newfname)
log_fatal("new_lease_file: lease file path too long");
- db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT, 0664);
+ db_fd = mkstemp (newfname);
if (db_fd < 0) {
log_error ("Can't create new lease file: %m");
return 0;
}
+ if (fchmod(db_fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) == -1) {
+ log_error ("Can't fchmod new lease file: %m");
+ goto fail;
+ }
#if defined (PARANOIA)
/*
--
2.1.4

View File

@ -1,29 +0,0 @@
From 92a611b4b05ef420e81c2c78f8c1eb3b38c31627 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 18 Aug 2011 10:28:04 +0200
Subject: [PATCH] dhcp-4.1.1-dhclient-exec-filedes
---
client/dhclient.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/client/dhclient.c b/client/dhclient.c
index 52121be..203d3d1 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -3369,6 +3369,12 @@ int script_go (client)
*/
if (leaseFile != NULL)
fclose(leaseFile);
+ if ((i = open("/dev/null", O_RDWR)) != -1) {
+ dup2(i, STDIN_FILENO);
+ dup2(i, STDOUT_FILENO);
+ if (i > STDERR_FILENO)
+ close(i);
+ }
execve (scriptName, argv, envp);
log_error ("execve (%s, ...): %m", scriptName);
exit (0);
--
1.8.4

View File

@ -1,131 +0,0 @@
From ec55fe43e597e5ea0f8dff5b8edef091c0911801 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 18 Aug 2011 10:49:07 +0200
Subject: [PATCH] dhcp-4.3.2-dhclient-send-hostname-or-fqdn
Signed-off-by: Marius Tomaschewski <mt@suse.de>
diff --git a/client/dhclient.8 b/client/dhclient.8
index 5b05698..d9a26b7 100644
--- a/client/dhclient.8
+++ b/client/dhclient.8
@@ -66,6 +66,10 @@ dhclient - Dynamic Host Configuration Protocol Client
.I LL|LLT
]
[
+.B -H
+.I hostname
+]
+[
.B -p
.I port-number
]
@@ -326,6 +330,11 @@ transmits these messages to 255.255.255.255 (the IP limited broadcast
address). Overriding this is mostly useful for debugging purposes. This
feature is not supported in DHCPv6 (\fB-6\fR) mode.
.TP
+.BI \-H \ hostname
+This flag may be used to specify a client hostname that should be sent to
+the DHCP server as host-name (ipv4 only) or fqdn to perform dns update.
+Note, that this option is a SUSE/Novell extension.
+.TP
.BI \-g \ relay
.\" mockup relay
Set the giaddr field of all packets to the \fIrelay\fR IP address
diff --git a/client/dhclient.c b/client/dhclient.c
index cf612d1..0e39161 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -124,6 +124,7 @@ main(int argc, char **argv) {
int no_dhclient_db = 0;
int no_dhclient_pid = 0;
int no_dhclient_script = 0;
+ char *dhclient_hostname = NULL;
#ifdef DHCPv6
int local_family_set = 0;
#endif /* DHCPv6 */
@@ -241,6 +242,24 @@ main(int argc, char **argv) {
if (++i == argc)
usage();
mockup_relay = argv[i];
+ } else if (!strcmp (argv[i], "-H")) {
+ size_t len;
+ if (++i == argc || !argv[i] || *(argv[i]) == '\0')
+ usage ();
+ len = strlen (argv[i]);
+ if (len > HOST_NAME_MAX) {
+ log_error("-H option hostname string \"%s\" is too long:"
+ "maximum length is %d characters",
+ argv[i], HOST_NAME_MAX);
+ exit(1);
+ } else if(check_domain_name(argv[i], len,
+ local_family == AF_INET6 ? 1 : 0) != 0) {
+ log_error("suspect %s in -H option: \"%s\"",
+ local_family == AF_INET6 ? "fqdn" : "hostname",
+ argv[i]);
+ exit(1);
+ }
+ dhclient_hostname = argv [i];
} else if (!strcmp(argv[i], "-nw")) {
nowait = 1;
} else if (!strcmp(argv[i], "-n")) {
@@ -510,6 +529,48 @@ main(int argc, char **argv) {
/* Parse the dhclient.conf file. */
read_client_conf();
+ /* If the user specified a hostname, send it here and now */
+ if ((dhclient_hostname != NULL) && (*dhclient_hostname != '\0') ) {
+ struct parse *cfile = NULL;
+ char buf[1024] = {'\0'};
+ int len;
+
+ if (strchr(dhclient_hostname, '.')) {
+ len = strlen(dhclient_hostname);
+ snprintf (buf, sizeof(buf),
+ "send fqdn.fqdn \"%s%s\";\n"
+ "send fqdn.encoded on;\n"
+ "send fqdn.server-update on;\n"
+ "also request %s;\n",
+ dhclient_hostname,
+ dhclient_hostname[len - 1] == '.' ? "" : ".",
+ local_family == AF_INET6 ? "dhcp6.fqdn" : "fqdn");
+ } else if (local_family == AF_INET) {
+ snprintf (buf, sizeof(buf),
+ "send host-name \"%s\";",
+ dhclient_hostname);
+ }
+ if ((len = strlen(buf))) {
+ status = new_parse (&cfile, -1, buf, len,
+ "hostname update options", 0);
+ if (status != ISC_R_SUCCESS)
+ log_fatal ("Cannot parse send host-name statement!");
+
+ for (;;) {
+ const char *val = NULL;
+ int token;
+
+ token = peek_token (&val, (unsigned *)0, cfile);
+ if (token == END_OF_FILE)
+ break;
+
+ parse_client_statement (cfile, NULL,
+ &top_level_config);
+ }
+ end_parse (&cfile);
+ }
+ }
+
/* Parse the lease database. */
read_client_leases();
@@ -756,6 +817,7 @@ static void usage()
#else /* DHCPv6 */
"[-I1dvrxi] [-nw] [-p <port>] [-D LL|LLT] \n"
#endif /* DHCPv6 */
+ " [-H hostname]\n"
" [-s server-addr] [-cf config-file]\n"
" [-df duid-file] [-lf lease-file]\n"
" [-pf pid-file] [--no-pid] [-e VAR=val]\n"
--
2.1.4

View File

@ -2,6 +2,7 @@ From a9d31f9f8356fba3fc49ead5afdfd8cca5a4a535 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Tue, 12 Jun 2012 08:54:23 +0200
Subject: [PATCH] dhcp-4.1.1-P1-lpf-bind-msg-fix
References: bnc#617795
---
common/lpf.c | 2 +-

View File

@ -2,6 +2,7 @@ From 48c1bbb9cbd6d6e71178e82fd45a7409efbb9d72 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Wed, 27 Apr 2011 13:56:47 +0200
Subject: [PATCH] dhcp-4.2.2-dhclient-option-checks
References: bnc#643845
---
client/dhclient.c | 6 +++---

View File

@ -2,6 +2,7 @@ From 61b4b713b630febf170c58c9ebbba2e01bb28eff Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 18 Aug 2011 15:09:01 +0200
Subject: [PATCH] dhcp-4.2.2-quiet-dhclient
References: bnc#711420
---
client/dhclient.c | 3 +++

View File

@ -2,6 +2,7 @@ From bd50ec560d7bec064190e4d430c066e170732c0e Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Tue, 27 Nov 2012 17:44:06 +0100
Subject: [PATCH] Fixed linux interface discovery using getifaddrs
References: bnc#791289,[ISC-Bugs #31992]
Unlike dhcp 3.x, dhcp 4.x scans interfaces from /proc/net/dev,
which provides only true interface names. When the address set

View File

@ -0,0 +1,84 @@
From 9267da086dcbb39509eae05d1d60ba37596a3f89 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Wed, 29 Apr 2015 11:18:36 +0200
Subject: dhclient6: unsigned lifetimes for script (bsc#926159)
Address/IA lifetimes are all unsigned, don't turn into signed
(negative e.g. in infinite case) when passing them to scripts
and format timestamps as long to not break them on 64bit archs.
References: bsc#926159
diff --git a/client/dhc6.c b/client/dhc6.c
index bec1c87..e4a85fc 100644
--- a/client/dhc6.c
+++ b/client/dhc6.c
@@ -3877,8 +3877,8 @@ dhc6_marshall_values(const char *prefix, struct client_state *client,
client_envadd(client, prefix,
"ip6_type", "temporary");
}
- client_envadd(client, prefix, "life_starts", "%d",
- (int)(addr->starts));
+ client_envadd(client, prefix, "life_starts", "%ld",
+ (long)(addr->starts));
client_envadd(client, prefix, "preferred_life", "%u",
addr->preferred_life);
client_envadd(client, prefix, "max_life", "%u",
@@ -3889,8 +3889,8 @@ dhc6_marshall_values(const char *prefix, struct client_state *client,
if (ia != NULL) {
client_envadd(client, prefix, "iaid", "%s",
print_hex_1(4, ia->iaid, 12));
- client_envadd(client, prefix, "starts", "%d",
- (int)(ia->starts));
+ client_envadd(client, prefix, "starts", "%ld",
+ (long)(ia->starts));
client_envadd(client, prefix, "renew", "%u", ia->renew);
client_envadd(client, prefix, "rebind", "%u", ia->rebind);
}
diff --git a/client/dhclient.c b/client/dhclient.c
index 2eb28db..4d7394d 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -3119,13 +3119,13 @@ write_client6_lease(struct client_state *client, struct dhc6_lease *lease,
return ISC_R_IOERROR;
if (ia->ia_type != D6O_IA_TA)
- stat = fprintf(leaseFile, " starts %d;\n"
+ stat = fprintf(leaseFile, " starts %ld;\n"
" renew %u;\n"
" rebind %u;\n",
- (int)ia->starts, ia->renew, ia->rebind);
+ (long)ia->starts, ia->renew, ia->rebind);
else
- stat = fprintf(leaseFile, " starts %d;\n",
- (int)ia->starts);
+ stat = fprintf(leaseFile, " starts %ld;\n",
+ (long)ia->starts);
if (stat <= 0)
return ISC_R_IOERROR;
@@ -3142,10 +3142,10 @@ write_client6_lease(struct client_state *client, struct dhc6_lease *lease,
if (stat <= 0)
return ISC_R_IOERROR;
- stat = fprintf(leaseFile, " starts %d;\n"
+ stat = fprintf(leaseFile, " starts %ld;\n"
" preferred-life %u;\n"
" max-life %u;\n",
- (int)addr->starts, addr->preferred_life,
+ (long)addr->starts, addr->preferred_life,
addr->max_life);
if (stat <= 0)
return ISC_R_IOERROR;
@@ -3519,7 +3519,7 @@ void script_write_params (client, prefix, lease)
universes [i],
&es, client_option_envadd);
}
- client_envadd (client, prefix, "expiry", "%d", (int)(lease -> expiry));
+ client_envadd (client, prefix, "expiry", "%ld", (long)(lease -> expiry));
}
/*
--
2.1.4

View File

@ -0,0 +1,69 @@
From 5fd4d0595760acd3e4c2524c9747dc5c0042e173 Mon Sep 17 00:00:00 2001
From: Tomas Hozza <thozza@redhat.com>
Date: Fri, 29 May 2015 13:56:58 +0200
Subject: Expose next-server DHCPv4 option to dhclient script
Currently dhclient does not exposes next-server option
to the dhclient script. this patch fixes this.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
References: bsc#928390
diff --git a/client/dhclient.c b/client/dhclient.c
index 4d7394d..0c77ae2 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -1104,7 +1104,7 @@ void state_selecting (cpp)
client -> state = S_REQUESTING;
/* Bind to the address we received. */
- bind_lease (client);
+ bind_lease (client, NULL);
return;
}
@@ -1294,11 +1294,12 @@ void dhcpack (packet)
if (client -> new -> rebind < cur_time)
client -> new -> rebind = TIME_MAX;
- bind_lease (client);
+ bind_lease (client, &packet -> raw -> siaddr);
}
-void bind_lease (client)
+void bind_lease (client, siaddr)
struct client_state *client;
+ struct in_addr *siaddr;
{
struct timeval tv;
@@ -1318,6 +1319,13 @@ void bind_lease (client)
if (client->alias)
script_write_params(client, "alias_", client->alias);
+ if (siaddr) {
+ char buf[INET_ADDRSTRLEN];
+
+ if (inet_ntop (AF_INET, (void *) siaddr, buf, sizeof (buf)))
+ client_envadd (client, "new_", "next_server", "%s", buf);
+ }
+
/* If the BOUND/RENEW code detects another machine using the
offered address, it exits nonzero. We need to send a
DHCPDECLINE and toss the lease. */
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
index 86d0afe..f0f4b20 100644
--- a/includes/dhcpd.h
+++ b/includes/dhcpd.h
@@ -2891,7 +2891,7 @@ void state_bound (void *);
void state_stop (void *);
void state_panic (void *);
-void bind_lease (struct client_state *);
+void bind_lease (struct client_state *, struct in_addr *);
void make_client_options (struct client_state *,
struct client_lease *, u_int8_t *,
--
2.1.4

View File

@ -1,3 +1,5 @@
References: bnc#870535,bsc#909189,bsc#910984
From 92250da05c2e4e3f1f60d627b52fe3f4f14828d3 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Mon, 14 Sep 2015 13:42:34 +0200
@ -9,7 +11,7 @@ commit 8f5918fa4319fc8173ca6e75d6e2ab8c379e980d
Author: Marius Tomaschewski <mt@suse.de>
Date: Mon Sep 14 12:26:12 2015 +0200
dhcp 4.3.3 ip over ib support fixes
dhcp 4.3.3 ip over ib support fixes (bsc#910984)
- verify client-identifier in responses as defined by RFC6864
- generate RFC4361 client-identifier for infiniband as required by

View File

@ -0,0 +1,104 @@
From ce15607bca2509bc2abd440000d25498ad589e27 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Mon, 14 Sep 2015 15:31:37 +0200
Subject: [PATCH] server: no success report before send (bsc#919959)
References: bsc#919959
---
server/dhcp.c | 53 ++++++++++++++++++++++++++++++-----------------------
1 file changed, 30 insertions(+), 23 deletions(-)
diff --git a/server/dhcp.c b/server/dhcp.c
index 0f53ac2..3a610e8 100644
--- a/server/dhcp.c
+++ b/server/dhcp.c
@@ -3643,22 +3643,6 @@ void dhcp_reply (lease)
} else
s = (char *)0;
- /* Say what we're doing... */
- log_info ("%s on %s to %s %s%s%svia %s",
- (state -> offer
- ? (state -> offer == DHCPACK ? "DHCPACK" : "DHCPOFFER")
- : "BOOTREPLY"),
- piaddr (lease -> ip_addr),
- (lease -> hardware_addr.hlen
- ? print_hw_addr (lease -> hardware_addr.hbuf [0],
- lease -> hardware_addr.hlen - 1,
- &lease -> hardware_addr.hbuf [1])
- : print_hex_1(lease->uid_len, lease->uid, 60)),
- s ? "(" : "", s ? s : "", s ? ") " : "",
- (state -> giaddr.s_addr
- ? inet_ntoa (state -> giaddr)
- : state -> ip -> name));
-
/* Set up the hardware address... */
hto.hlen = lease -> hardware_addr.hlen;
memcpy (hto.hbuf, lease -> hardware_addr.hbuf, hto.hlen);
@@ -3695,12 +3679,13 @@ void dhcp_reply (lease)
"packet over %s interface.", MDL,
packet_length,
fallback_interface->name);
- }
+ free_lease_state (state, MDL);
+ lease -> state = (struct lease_state *)0;
+ return;
+ }
- free_lease_state (state, MDL);
- lease -> state = (struct lease_state *)0;
- return;
+ goto report;
}
/* If the client is RENEWING, unicast to the client using the
@@ -3733,11 +3718,13 @@ void dhcp_reply (lease)
" packet over %s interface.", MDL,
packet_length,
fallback_interface->name);
+
+ free_lease_state (state, MDL);
+ lease -> state = (struct lease_state *)0;
+ return;
}
- free_lease_state (state, MDL);
- lease -> state = (struct lease_state *)0;
- return;
+ goto report;
}
/* If it comes from a client that already knows its address
@@ -3765,8 +3752,28 @@ void dhcp_reply (lease)
log_error ("%s:%d: Failed to send %d byte long "
"packet over %s interface.", MDL,
packet_length, state->ip->name);
+
+ free_lease_state (state, MDL);
+ lease -> state = (struct lease_state *)0;
+ return;
}
+report:
+ /* Say what we're doing... */
+ log_info ("%s on %s to %s %s%s%svia %s",
+ (state -> offer
+ ? (state -> offer == DHCPACK ? "DHCPACK" : "DHCPOFFER")
+ : "BOOTREPLY"),
+ piaddr (lease -> ip_addr),
+ (lease -> hardware_addr.hlen
+ ? print_hw_addr (lease -> hardware_addr.hbuf [0],
+ lease -> hardware_addr.hlen - 1,
+ &lease -> hardware_addr.hbuf [1])
+ : print_hex_1(lease->uid_len, lease->uid, 60)),
+ s ? "(" : "", s ? s : "", s ? ") " : "",
+ (state -> giaddr.s_addr
+ ? inet_ntoa (state -> giaddr)
+ : state -> ip -> name));
/* Free all of the entries in the option_state structure
now that we're done with them. */
--
2.1.4

View File

@ -1,11 +1,14 @@
-------------------------------------------------------------------
Mon Sep 14 11:02:45 UTC 2015 - mt@suse.de
Mon Sep 14 14:39:34 UTC 2015 - mt@suse.de
- Update to dhcp-4.3.3 (fate#319067) provinding many bug fixes,
features and obsoletes several patches we were using before.
For complete list of the changes, please read the RELNOTES
file shipped along with the package or online:
For complete changelog, please read the RELNOTES file shipped
along with this package or online at:
https://kb.isc.org/article/AA-01297/82/DHCP-4.3.3-Release-Notes.html
- Replaced hostname patch with a dhcpv6 and fqdn aware variant:
[- 0006-dhcp-4.2.5-dhclient-send-hostname-rml.patch,
+ 0006-dhcp-4.3.2-dhclient-send-hostname-or-fqdn.patch]
- Removed obsolete patches included upstream now:
[- 0007-dhcp-4.2.6-ldap-mt01.patch,
- 0009-dhcp-4.2.6-xen-checksum.patch,
@ -18,18 +21,37 @@ Mon Sep 14 11:02:45 UTC 2015 - mt@suse.de
- 0023-dhcp-4.2.x-ddns-tsig-hmac-sha-support.890731.patch,
- 0025-dhcp-4.2.x-dhcpv6-retransmission-until-MRD.872609.patch,
- 0026-dhcp-4.2.x-disable-unused-ddns-port-in-server.891655.patch]
- Replaced hostname patch with a dhcpv6 and fqdn aware variant:
[- 0006-dhcp-4.2.5-dhclient-send-hostname-rml.patch,
+ 0006-dhcp-4.3.2-dhclient-send-hostname-or-fqdn.patch]
- Replaced infiniband support patch with fixed variant:
[- 0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch
- 0018-dhcp-4.2.6-improved-xid.patch
- Adjusted patch numbers in the spec file:
[- 0008-dhcp-4.1.1-P1-lpf-bind-msg-fix.patch,
- 0010-dhcp-4.2.2-dhclient-option-checks.patch,
- 0011-dhcp-4.2.6-close-on-exec.patch,
- 0012-dhcp-4.2.2-quiet-dhclient.patch,
- 0014-Fixed-linux-interface-discovery-using-getifaddrs.patch,
- 0020-dhcp-4.2.x-chown-server-leases.bnc868253.patch,
- 0024-dhcp-4.2.x-dhcpv6-decline-on-DAD-failure.872609.patch,
+ 0008-dhcp-4.2.2-dhclient-option-checks.patch,
+ 0009-dhcp-4.2.6-close-on-exec.patch,
+ 0010-dhcp-4.2.2-quiet-dhclient.patch,
+ 0011-Fixed-linux-interface-discovery-using-getifaddrs.patch,
+ 0012-dhcp-4.2.x-chown-server-leases.bnc868253.patch,
+ 0013-dhcp-4.2.x-dhcpv6-decline-on-DAD-failure.872609.patch]
- Fixed to not pass DHCPv6 address lifetimes a positive (unsigned
32bit) integers to scripts and properly format timestamps as long
to not break them on 64bit architectures (bsc#926159).
[+ 0014-dhclient6-unsigned-lifetimes-for-script-bsc-926159.patch]
- dhclient: expose next-server DHCPv4 option to script (bsc#928390)
[+ 0015-Expose-next-server-DHCPv4-option-to-dhclient-script.patch]
- Replaced infiniband support patch with fixed variant (bsc#910984):
[- 0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch,
- 0018-dhcp-4.2.6-improved-xid.patch,
- 0027-dhcp-4.2.x-handle-ifa_addr-NULL.909189.patch,
+ 0030-infiniband-support.patch]
- Merged/Adopted patches for the dhcp-4.3.3 sources:
[* 0004-dhcp-4.1.1-tmpfile.patch,
* 0011-dhcp-4.2.6-close-on-exec.patch,
* 0020-dhcp-4.2.x-chown-server-leases.bnc868253.patch]
+ 0016-infiniband-support.patch]
- Moved dhcp-devel package include files and static libraries
to /usr/include/dhcp and /usr/lib/dhcp subdirectories.
DHCP requires a specific bind library version and conflicts
with the files shipped by bind-devel package, which is not
source and binary compatible (bsc#910686).
- Corrected changes to provide complete patch file references.
-------------------------------------------------------------------
Tue Feb 3 18:37:59 UTC 2015 - coolo@suse.com

View File

@ -93,21 +93,27 @@ Patch4: 0004-dhcp-4.1.1-tmpfile.patch
Patch5: 0005-dhcp-4.1.1-dhclient-exec-filedes.patch
Patch6: 0006-dhcp-4.3.2-dhclient-send-hostname-or-fqdn.patch
# PATCH-FIX-UPSTREAM lpf-bind-msg-fix bnc#617795
Patch8: 0008-dhcp-4.1.1-P1-lpf-bind-msg-fix.patch
Patch7: 0007-dhcp-4.1.1-P1-lpf-bind-msg-fix.patch
# PATCH-FIX-SLE dhclient-option-checks bnc#675052
Patch10: 0010-dhcp-4.2.2-dhclient-option-checks.patch
Patch8: 0008-dhcp-4.2.2-dhclient-option-checks.patch
# PATCH-FIX-OPENSUSE close-on-exec bnc#732910
Patch11: 0011-dhcp-4.2.6-close-on-exec.patch
Patch9: 0009-dhcp-4.2.6-close-on-exec.patch
# PATCH-FIX-OPENSUSE quiet-dhclient bnc#711420
Patch12: 0012-dhcp-4.2.2-quiet-dhclient.patch
Patch10: 0010-dhcp-4.2.2-quiet-dhclient.patch
# PATCH-FIX-UPSTREAM use-getifaddrs bnc#791289,ISC-Bugs#31992
Patch14: 0014-Fixed-linux-interface-discovery-using-getifaddrs.patch
Patch11: 0011-Fixed-linux-interface-discovery-using-getifaddrs.patch
# PATCH-FIX-OPENSUSE dhcp-4.2.x-chown-server-leases bnc#868253
Patch20: 0020-dhcp-4.2.x-chown-server-leases.bnc868253.patch
Patch12: 0012-dhcp-4.2.x-chown-server-leases.bnc868253.patch
# PATCH-FIX-SLE dhcp-4.2.x-dhcpv6-decline-on-DAD-failure bnc#872609
Patch24: 0024-dhcp-4.2.x-dhcpv6-decline-on-DAD-failure.872609.patch
# PATCH-FIX-SLE
Patch30: 0030-infiniband-support.patch
Patch13: 0013-dhcp-4.2.x-dhcpv6-decline-on-DAD-failure.872609.patch
# PATCH-FIX-SLE dhclient6-unsigned-lifetimes-for-script bsc#926159
Patch14: 0014-dhclient6-unsigned-lifetimes-for-script-bsc-926159.patch
# PATCH-FIX-SLE Expose-next-server-DHCPv4-option-to-dhclient-script bsc#928390
Patch15: 0015-Expose-next-server-DHCPv4-option-to-dhclient-script.patch
# PATCH-FIX-SLE infiniband-support bnc#870535,bsc#909189,bsc#910984
Patch16: 0016-infiniband-support.patch
# PATCH-FIX-SLE server-no-success-report-before-send bsc#919959
Patch17: 0017-server-no-success-report-before-send.919959.patch
##
PreReq: /bin/touch /sbin/chkconfig sysconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -141,7 +147,6 @@ PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp
Summary: Header Files and Libraries for dhcpctl API
Group: Development/Libraries/C and C++
Requires: dhcp = %{version}
Conflicts: bind-devel
%if %{with_doc_package}
@ -227,14 +232,17 @@ Authors:
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch20 -p1
%patch24 -p1
%patch30 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
##
find . -type f -name \*.cat\* -exec rm -f {} \;
dos2unix contrib/ms2isc/*
@ -454,15 +462,20 @@ rm -f $RPM_BUILD_ROOT/etc/{dhcpd,dhclient}.conf.example
find contrib doc/examples -type f | xargs chmod -x
# install bind libs+includes needed for dhcp-devel
pushd bind
install -d -m0755 $RPM_BUILD_ROOT%_includedir/
install -d -m0755 $RPM_BUILD_ROOT%_includedir/dhcp/
for i in include/* ; do
cp -r $i $RPM_BUILD_ROOT%_includedir/
cp -r $i $RPM_BUILD_ROOT%_includedir/dhcp/
done
install -d -m0755 $RPM_BUILD_ROOT%_libdir/
install -d -m0755 $RPM_BUILD_ROOT%_libdir/dhcp/
for l in lib/lib*.a ; do
install -m0644 $l $RPM_BUILD_ROOT%_libdir/
install -m0644 $l $RPM_BUILD_ROOT%_libdir/dhcp/
done
popd
# move also all dhcp-devel files to dhcp subdirectories
mv $RPM_BUILD_ROOT%_includedir/{dhcpctl,isc-dhcp,omapip} \
$RPM_BUILD_ROOT%_includedir/dhcp/
mv $RPM_BUILD_ROOT%_libdir/lib*.* \
$RPM_BUILD_ROOT%_libdir/dhcp/
%pre server
/usr/sbin/useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d /var/lib/dhcp dhcpd 2> /dev/null ||:
@ -686,8 +699,10 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
%files devel
%defattr(-,root,root)
%_libdir/lib*
%{_prefix}/include/*
%dir %_libdir/dhcp
%_libdir/dhcp/lib*
%dir %{_prefix}/include/dhcp
%{_prefix}/include/dhcp/*
%doc %{_mandir}/man3/omapi.3.gz
%doc %{_mandir}/man3/dhcpctl.3.gz