From: Roy Marples Date: Tue, 19 May 2020 16:44:49 +0000 (+0000) Subject: Linux: workaround a kernel bug when sending DHCPv6 over SOCK_RAW X-Git-Tag: v9.1.0~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4a1bd6bf60f4857c45519d62013b8d77c5915b0;p=thirdparty%2Fdhcpcd.git Linux: workaround a kernel bug when sending DHCPv6 over SOCK_RAW The equivalent works fine for DHCP messages, so hum ho. --- 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),