changeset 5236:40c8b6fa2033 draft

Linux: workaround a kernel bug when sending DHCPv6 over SOCK_RAW The equivalent works fine for DHCP messages, so hum ho.
author Roy Marples <roy@marples.name>
date Tue, 19 May 2020 16:44:49 +0000
parents 23363945d9a1
children 65cef5f96919
files src/dhcp6.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcp6.c	Tue May 19 16:13:06 2020 +0000
+++ b/src/dhcp6.c	Tue May 19 16:44:49 2020 +0000
@@ -1209,7 +1209,12 @@
 	bool broadcast = true;
 	struct sockaddr_in6 dst = {
 	    .sin6_family = AF_INET6,
+	    /* Setting the port on Linux gives EINVAL when sending.
+	     * This looks like a kernel bug as the equivalent works
+	     * fine with the DHCP counterpart. */
+#ifndef __linux__
 	    .sin6_port = htons(DHCP6_SERVER_PORT),
+#endif
 	};
 	struct udphdr udp = {
 	    .uh_sport = htons(DHCP6_CLIENT_PORT),