Marius Tomaschewski
58f1b21b5d
complete list of changes -- digest of fixes not in dhcp-4.2.4-P2: - Correct code to calculate rebind timing values in client [ISC-Bugs #29062] - Fix some issues in the code for parsing and printing options. [ISC-Bugs #22625,#27289,#27296,#27314] - Update the memory leakage debug code to work with v6. [ISC-Bugs #30297] - Relax the requirements for deleting an A or AAAA record. This relaxation was codified in RFC 4703. [ISC-Bugs #30734] - Modify the failover code to handle incorrect peer names better. [ISC-Bugs #30320] - Fix a set of issues that were discovered via a code inspection tool. [ISC-Bugs #23833] - Parsing unquoted base64 strings improved. [ISC-Bugs #23048] - The client now passes information about the options it requested from the server to the script code via environment variables. These variables are of the form requested_<option_name>=1 with the option name being the same as used in the new_* and old_* variables. [ISC-Bugs #29068] - Check the status value when trying to read from a connection to see if it may have been closed. If it appears closed don't try to read from it again. This avoids a potential busy-wait like loop when the peer names are mismatched. [ISC-Bugs #31231] - Remove an unused variable to keep compilers happy. [ISC-Bugs #31983] - Removed obsolete parsing and printing option patch [dhcp-4.2.4-parsing-and-printing-options.patch] - Merged dhcp-4.2.2-dhclient-send-hostname-rml.diff [dhcp-4.2.5-dhclient-send-hostname-rml.patch] OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=96
83 lines
2.1 KiB
Diff
83 lines
2.1 KiB
Diff
From 633817ad53adbdeb4054b750e1f0bd4ce58f341b Mon Sep 17 00:00:00 2001
|
|
From: Marius Tomaschewski <mt@suse.de>
|
|
Date: Thu, 20 Dec 2012 10:25:53 +0100
|
|
Subject: [PATCH] Ignore SIGPIPE to not die in socket code
|
|
References: bnc#794578
|
|
Upstream: sent [ISC-Bugs #32222]
|
|
|
|
Installed SIG_IGN handler for SIGPIPE to not die before
|
|
the errno==EPIPE checks in the socket code are reached.
|
|
Unlike isc_app_start(), the isc_app_ctxstart() used by
|
|
dhcp, does not set any signal handlers.
|
|
|
|
Reported upstream as [ISC-Bugs #32222], IMO regression
|
|
to [ISC-Bugs #22269] as the SO_NOSIGPIPE socket option
|
|
isn't available e.g. on Linux.
|
|
|
|
Signed-off-by: Marius Tomaschewski <mt@suse.de>
|
|
---
|
|
omapip/isclib.c | 33 ++++++++++++++++++++++++++++++++-
|
|
1 Datei geändert, 32 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
|
|
|
|
diff --git a/omapip/isclib.c b/omapip/isclib.c
|
|
index 1534dde..27bb887 100644
|
|
--- a/omapip/isclib.c
|
|
+++ b/omapip/isclib.c
|
|
@@ -28,6 +28,7 @@
|
|
#include "dhcpd.h"
|
|
|
|
#include <sys/time.h>
|
|
+#include <signal.h>
|
|
|
|
dhcp_context_t dhcp_gbl_ctx;
|
|
|
|
@@ -67,6 +68,23 @@ isclib_cleanup(void)
|
|
return;
|
|
}
|
|
|
|
+static isc_result_t
|
|
+handle_signal(int sig, void (*handler)(int)) {
|
|
+ struct sigaction sa;
|
|
+
|
|
+ memset(&sa, 0, sizeof(sa));
|
|
+ sa.sa_handler = handler;
|
|
+
|
|
+ if (sigfillset(&sa.sa_mask) != 0 ||
|
|
+ sigaction(sig, &sa, NULL) < 0) {
|
|
+ log_error("handle_signal() %d setup: %s",
|
|
+ sig, strerror(errno));
|
|
+ return (ISC_R_UNEXPECTED);
|
|
+ }
|
|
+
|
|
+ return (ISC_R_SUCCESS);
|
|
+}
|
|
+
|
|
isc_result_t
|
|
dhcp_context_create(void) {
|
|
isc_result_t result;
|
|
@@ -104,7 +122,20 @@ dhcp_context_create(void) {
|
|
|
|
result = isc_app_ctxstart(dhcp_gbl_ctx.actx);
|
|
if (result != ISC_R_SUCCESS)
|
|
- return (result);
|
|
+ goto cleanup;
|
|
+
|
|
+ /*
|
|
+ * Always ignore SIGPIPE.
|
|
+ * Otherwise we will die before the errno == EPIPE
|
|
+ * checks in the socket code are reached.
|
|
+ *
|
|
+ * Note: unlike isc_app_start(), isc_app_ctxstart()
|
|
+ * does not set any signal handlers.
|
|
+ */
|
|
+ result = handle_signal(SIGPIPE, SIG_IGN);
|
|
+ if (result != ISC_R_SUCCESS)
|
|
+ goto cleanup;
|
|
+
|
|
dhcp_gbl_ctx.actx_started = ISC_TRUE;
|
|
|
|
result = isc_taskmgr_createinctx(dhcp_gbl_ctx.mctx,
|
|
--
|
|
1.7.10.4
|
|
|