Skip to content
Snippets Groups Projects
Unverified Commit 5ab2725c authored by Michal Hrusecky's avatar Michal Hrusecky :mouse:
Browse files

odhcp6c: Rebase DUID patch

parent 96b79033
Branches
Tags
No related merge requests found
From b9d1372080d34045a0aaa4053f14e79c2f00bc20 Mon Sep 17 00:00:00 2001
From 68aa47f3546d935750239cdc38fb6ad1260745ab Mon Sep 17 00:00:00 2001
From: Stepan Henek <stepan.henek@nic.cz>
Date: Tue, 22 May 2018 16:42:19 +0200
Subject: [PATCH] odhcp6c: export DUID to /var/run/odhcp6c-duid.{ifname}
......@@ -11,14 +11,14 @@ Signed-off-by: Stepan Henek <stepan.henek@nic.cz>
diff --git a/package/network/ipv6/odhcp6c/patches/020-duid-path.patch b/package/network/ipv6/odhcp6c/patches/020-duid-path.patch
new file mode 100644
index 0000000000..053834ba18
index 0000000..6d9635f
--- /dev/null
+++ b/package/network/ipv6/odhcp6c/patches/020-duid-path.patch
@@ -0,0 +1,134 @@
+diff --git a/src/dhcpv6.c b/src/dhcpv6.c
+index 4728d89..f3160bd 100644
+--- a/src/dhcpv6.c
++++ b/src/dhcpv6.c
+Index: odhcp6c-2018-07-14-67ae6a71/src/dhcpv6.c
+===================================================================
+--- odhcp6c-2018-07-14-67ae6a71.orig/src/dhcpv6.c
++++ odhcp6c-2018-07-14-67ae6a71/src/dhcpv6.c
+@@ -25,6 +25,7 @@
+ #include <unistd.h>
+ #include <syslog.h>
......@@ -27,7 +27,7 @@ index 0000000000..053834ba18
+ #include <ctype.h>
+ #include <sys/time.h>
+ #include <sys/ioctl.h>
+@@ -123,7 +124,7 @@ static uint32_t ntohl_unaligned(const uint8_t *data)
+@@ -123,7 +124,7 @@ static uint32_t ntohl_unaligned(const ui
+ return ntohl(buf);
+ }
+
......@@ -36,7 +36,7 @@ index 0000000000..053834ba18
+ {
+ client_options = options;
+ dhcpv6_retx[DHCPV6_MSG_SOLICIT].max_timeo = sol_timeout;
+@@ -175,6 +176,29 @@ int init_dhcpv6(const char *ifname, unsigned int options, int sol_timeout)
+@@ -176,6 +177,29 @@ int init_dhcpv6(const char *ifname, unsi
+ odhcp6c_add_state(STATE_CLIENT_ID, duid, sizeof(duid));
+ }
+
......@@ -66,11 +66,11 @@ index 0000000000..053834ba18
+ // Create ORO
+ if (!(client_options & DHCPV6_STRICT_OPTIONS)) {
+ uint16_t oro[] = {
+diff --git a/src/odhcp6c.c b/src/odhcp6c.c
+index e03f282..c9c14e7 100644
+--- a/src/odhcp6c.c
++++ b/src/odhcp6c.c
+@@ -121,6 +121,7 @@ int main(_unused int argc, char* const argv[])
+Index: odhcp6c-2018-07-14-67ae6a71/src/odhcp6c.c
+===================================================================
+--- odhcp6c-2018-07-14-67ae6a71.orig/src/odhcp6c.c
++++ odhcp6c-2018-07-14-67ae6a71/src/odhcp6c.c
+@@ -121,6 +121,7 @@ int main(_unused int argc, char* const a
+ // Allocate resources
+ const char *pidfile = NULL;
+ const char *script = "/usr/sbin/odhcp6c-update";
......@@ -78,16 +78,16 @@ index 0000000000..053834ba18
+ ssize_t l;
+ uint8_t buf[134], *o_data;
+ char *optpos;
+@@ -138,7 +139,7 @@ int main(_unused int argc, char* const argv[])
+@@ -138,7 +139,7 @@ int main(_unused int argc, char* const a
+ unsigned int ra_options = RA_RDNSS_DEFAULT_LIFETIME;
+ unsigned int ra_holdoff_interval = RA_MIN_ADV_INTERVAL;
+
+- while ((c = getopt(argc, argv, "S::N:V:P:FB:c:i:r:Ru:x:s:kt:m:Lhedp:fav")) != -1) {
++ while ((c = getopt(argc, argv, "S::N:V:P:FB:c:C:i:r:Ru:x:s:kt:m:Lhedp:fav")) != -1) {
+- while ((c = getopt(argc, argv, "S::N:V:P:FB:c:i:r:Ru:Ux:s:kt:m:Lhedp:fav")) != -1) {
++ while ((c = getopt(argc, argv, "S::N:V:P:FB:c:C:i:r:Ru:Ux:s:kt:m:Lhedp:fav")) != -1) {
+ switch (c) {
+ case 'S':
+ allow_slaac_only = (optarg) ? atoi(optarg) : -1;
+@@ -231,6 +232,10 @@ int main(_unused int argc, char* const argv[])
+@@ -231,6 +232,10 @@ int main(_unused int argc, char* const a
+ help = true;
+ break;
+
......@@ -98,7 +98,7 @@ index 0000000000..053834ba18
+ case 'i':
+ if (inet_pton(AF_INET6, optarg, &ifid) != 1)
+ help = true;
+@@ -360,7 +365,7 @@ int main(_unused int argc, char* const argv[])
+@@ -364,7 +369,7 @@ int main(_unused int argc, char* const a
+ signal(SIGUSR2, sighandler);
+
+ if ((urandom_fd = open("/dev/urandom", O_CLOEXEC | O_RDONLY)) < 0 ||
......@@ -107,19 +107,19 @@ index 0000000000..053834ba18
+ ra_init(ifname, &ifid, ra_options, ra_holdoff_interval) ||
+ script_init(script, ifname)) {
+ syslog(LOG_ERR, "failed to initialize: %s", strerror(errno));
+@@ -561,6 +566,7 @@ static int usage(void)
+ " -x 15:office - option 15 (userclass)\n"
+@@ -566,6 +571,7 @@ static int usage(void)
+ " -x 0x1f4:ABBA - option 500\n"
+ " -x 202:'\"file\"' - option 202\n"
+ " -c <clientid> Override client-ID (base-16 encoded 16-bit type + value)\n"
++ " -C <path> Export used client-ID to specified path\n"
+ " -i <iface-id> Use a custom interface identifier for RA handling\n"
+ " -r <options> Options to be requested (comma-separated)\n"
+ " -R Do not request any options except those specified with -r\n"
+diff --git a/src/odhcp6c.h b/src/odhcp6c.h
+index e41aa3c..5a6009c 100644
+--- a/src/odhcp6c.h
++++ b/src/odhcp6c.h
+@@ -339,7 +339,7 @@ struct odhcp6c_opt {
+Index: odhcp6c-2018-07-14-67ae6a71/src/odhcp6c.h
+===================================================================
+--- odhcp6c-2018-07-14-67ae6a71.orig/src/odhcp6c.h
++++ odhcp6c-2018-07-14-67ae6a71/src/odhcp6c.h
+@@ -341,7 +341,7 @@ struct odhcp6c_opt {
+ const char *str;
+ };
+
......@@ -128,7 +128,7 @@ index 0000000000..053834ba18
+ int dhcpv6_set_ia_mode(enum odhcp6c_ia_mode na, enum odhcp6c_ia_mode pd);
+ int dhcpv6_request(enum dhcpv6_msg type);
+ int dhcpv6_poll_reconfigure(void);
+@@ -356,6 +356,7 @@ int ra_conf_retransmit(int newvalue);
+@@ -358,6 +358,7 @@ int ra_get_retransmit(void);
+
+ int script_init(const char *path, const char *ifname);
+ ssize_t script_unhexlify(uint8_t *dst, size_t len, const char *src);
......@@ -136,11 +136,11 @@ index 0000000000..053834ba18
+ void script_call(const char *status, int delay, bool resume);
+
+ bool odhcp6c_signal_process(void);
+diff --git a/src/script.c b/src/script.c
+index 5696b7f..efe8a8f 100644
+--- a/src/script.c
++++ b/src/script.c
+@@ -84,7 +84,7 @@ ssize_t script_unhexlify(uint8_t *dst, size_t len, const char *src)
+Index: odhcp6c-2018-07-14-67ae6a71/src/script.c
+===================================================================
+--- odhcp6c-2018-07-14-67ae6a71.orig/src/script.c
++++ odhcp6c-2018-07-14-67ae6a71/src/script.c
+@@ -84,7 +84,7 @@ ssize_t script_unhexlify(uint8_t *dst, s
+ return c;
+ }
+
......@@ -150,5 +150,5 @@ index 0000000000..053834ba18
+ for (size_t i = 0; i < len; ++i) {
+ *dst++ = hexdigits[src[i] >> 4];
--
2.17.0
2.18.0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment