odhcpd: fix a compilation error
authorDavid Härdeman <[email protected]>
Thu, 9 Oct 2025 09:08:14 +0000 (11:08 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Fri, 10 Oct 2025 06:29:58 +0000 (08:29 +0200)
odhcpd_get_interface_dns_addr() calls odhcpd_get_interface_linklocal_addr(),
the former takes a const struct interface ptr, the latter takes a non-const
struct interface ptr.

The end result is an unhappy compiler.

Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/272
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/odhcpd.c
src/odhcpd.h

index 313dae1129b990232c4b01dd726da2057f87217d..5116ba31b2caddb206e2e511267a20e727534999 100644 (file)
@@ -331,7 +331,7 @@ ssize_t odhcpd_try_send_with_src(int socket, struct sockaddr_in6 *dest,
  * - use an IPv6 ULA address if the already selected IPv6 address is not an ULA address
  * - use the IPv6 address with the longest preferred lifetime
  */
-int odhcpd_get_interface_dns_addr(const struct interface *iface, struct in6_addr *addr)
+int odhcpd_get_interface_dns_addr(struct interface *iface, struct in6_addr *addr)
 {
        time_t now = odhcpd_time();
        ssize_t m = -1;
index e96cc359d6b3ee563d2ee0baba99da77e19e8524..be80646860be1787776bcf037b093e894546a46a 100644 (file)
@@ -491,7 +491,7 @@ ssize_t odhcpd_send(int socket, struct sockaddr_in6 *dest,
 ssize_t odhcpd_try_send_with_src(int socket, struct sockaddr_in6 *dest,
                struct iovec *iov, size_t iov_len,
                struct interface *iface);
-int odhcpd_get_interface_dns_addr(const struct interface *iface,
+int odhcpd_get_interface_dns_addr(struct interface *iface,
                struct in6_addr *addr);
 int odhcpd_get_interface_linklocal_addr(struct interface *iface,
                struct in6_addr *addr);