aboutsummaryrefslogtreecommitdiff
path: root/net/dhcp6/files
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2015-11-12 03:46:05 +0000
committerHiroki Sato <hrs@FreeBSD.org>2015-11-12 03:46:05 +0000
commit4c363a4a2ea593ada60d68b2bfc8da2cb68c3f33 (patch)
treeaf85a2f28bb0e54f881c398df17670ba4e3c167a /net/dhcp6/files
parent82ee44b8d5b38dfdf89b4bffd13f4fa90974fff6 (diff)
downloadports-4c363a4a2ea593ada60d68b2bfc8da2cb68c3f33.tar.gz
ports-4c363a4a2ea593ada60d68b2bfc8da2cb68c3f33.zip
Notes
Diffstat (limited to 'net/dhcp6/files')
-rw-r--r--net/dhcp6/files/patch-Makefile.in6
-rw-r--r--net/dhcp6/files/patch-dhcp6c.c72
2 files changed, 75 insertions, 3 deletions
diff --git a/net/dhcp6/files/patch-Makefile.in b/net/dhcp6/files/patch-Makefile.in
index 63d8ae021c52..fc873189fca8 100644
--- a/net/dhcp6/files/patch-Makefile.in
+++ b/net/dhcp6/files/patch-Makefile.in
@@ -1,6 +1,6 @@
---- Makefile.in.orig 2007-03-21 18:52:58.000000000 +0900
-+++ Makefile.in 2013-10-17 12:26:22.000000000 +0900
-@@ -102,14 +102,14 @@
+--- Makefile.in.orig 2007-03-21 09:52:58 UTC
++++ Makefile.in
+@@ -102,14 +102,14 @@ $(srcdir)/ianaopts.h: gentab.pl bootp-dh
expand bootp-dhcp-parameters | perl gentab.pl > ianaopts.h
install::
diff --git a/net/dhcp6/files/patch-dhcp6c.c b/net/dhcp6/files/patch-dhcp6c.c
new file mode 100644
index 000000000000..70645a010f34
--- /dev/null
+++ b/net/dhcp6/files/patch-dhcp6c.c
@@ -0,0 +1,72 @@
+--- dhcp6c.c.orig 2008-06-15 07:48:41 UTC
++++ dhcp6c.c
+@@ -67,6 +67,7 @@
+ #include <string.h>
+ #include <err.h>
+ #include <ifaddrs.h>
++#include <fcntl.h>
+
+ #include <dhcp6.h>
+ #include <config.h>
+@@ -257,7 +258,7 @@ client6_init()
+ {
+ struct addrinfo hints, *res;
+ static struct sockaddr_in6 sa6_allagent_storage;
+- int error, on = 1;
++ int error, on = 0;
+
+ /* get our DUID */
+ if (get_duid(DUID_FILE, &client_duid)) {
+@@ -287,6 +288,20 @@ client6_init()
+ dprintf(LOG_ERR, FNAME, "socket");
+ exit(1);
+ }
++
++ if ((on = fcntl(sock, F_GETFL, 0)) == -1) {
++ dprintf(LOG_ERR, FNAME, "fctnl getflags");
++ exit(1);
++ }
++
++ on |= FD_CLOEXEC;
++
++ if ((on = fcntl(sock, F_SETFL, on)) == -1) {
++ dprintf(LOG_ERR, FNAME, "fctnl setflags");
++ exit(1);
++ }
++
++ on = 1;
+ if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
+ &on, sizeof(on)) < 0) {
+ dprintf(LOG_ERR, FNAME,
+@@ -1828,15 +1843,6 @@ client6_recvreply(ifp, dh6, len, optinfo
+ }
+
+ /*
+- * Call the configuration script, if specified, to handle various
+- * configuration parameters.
+- */
+- if (ifp->scriptpath != NULL && strlen(ifp->scriptpath) != 0) {
+- dprintf(LOG_DEBUG, FNAME, "executes %s", ifp->scriptpath);
+- client6_script(ifp->scriptpath, state, optinfo);
+- }
+-
+- /*
+ * Set refresh timer for configuration information specified in
+ * information-request. If the timer value is specified by the server
+ * in an information refresh time option, use it; use the protocol
+@@ -1888,6 +1894,15 @@ client6_recvreply(ifp, dh6, len, optinfo
+ &optinfo->serverID, ev->authparam);
+ }
+
++ /*
++ * Call the configuration script, if specified, to handle various
++ * configuration parameters.
++ */
++ if (ifp->scriptpath != NULL && strlen(ifp->scriptpath) != 0) {
++ dprintf(LOG_DEBUG, FNAME, "executes %s", ifp->scriptpath);
++ client6_script(ifp->scriptpath, state, optinfo);
++ }
++
+ dhcp6_remove_event(ev);
+
+ if (state == DHCP6S_RELEASE) {