From b4a1bd6bf60f4857c45519d62013b8d77c5915b0 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 19 May 2020 16:44:49 +0000 Subject: [PATCH] Linux: workaround a kernel bug when sending DHCPv6 over SOCK_RAW The equivalent works fine for DHCP messages, so hum ho. --- src/dhcp6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dhcp6.c b/src/dhcp6.c index e432bfa4..ad0f9b54 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -1209,7 +1209,12 @@ dhcp6_sendmessage(struct interface *ifp, void (*callback)(void *)) 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), -- 2.47.2