]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Linux: workaround a kernel bug when sending DHCPv6 over SOCK_RAW
authorRoy Marples <roy@marples.name>
Tue, 19 May 2020 16:44:49 +0000 (16:44 +0000)
committerRoy Marples <roy@marples.name>
Tue, 19 May 2020 16:44:49 +0000 (16:44 +0000)
The equivalent works fine for DHCP messages, so hum ho.

src/dhcp6.c

index e432bfa40ab9e7ba66b05107c48011105d4374d2..ad0f9b548df73181911bfc9f72bdd18ca6ce70e4 100644 (file)
@@ -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),