odhcpd: rename union if_addr -> in46_addr
authorDavid Härdeman <[email protected]>
Mon, 17 Nov 2025 22:11:08 +0000 (23:11 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Thu, 27 Nov 2025 07:23:41 +0000 (08:23 +0100)
Anyone reading "union if_addr" might be tempted to think it's got
something to do with an interface addr (e.g. a MAC, or something). In
reality, it's an IPv4/IPv6 addr (i.e. struct in_addr or struct
in6_addr), so rename it to make things clearer.

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

index 0bf919631650e8736e7282f39d06f3645ce37e73..b706831c5180431f2620dd8e3fcfde2f5950dc44 100644 (file)
@@ -115,7 +115,7 @@ typedef     ssize_t (*send_reply_cb_t)(struct iovec *iov, size_t iov_len,
                                   struct sockaddr *dest, socklen_t dest_len,
                                   void *opaque);
 
-union if_addr {
+union in46_addr {
        struct in_addr in;
        struct in6_addr in6;
 };
@@ -124,12 +124,12 @@ struct netevent_handler_info {
        struct interface *iface;
        union {
                struct {
-                       union if_addr dst;
+                       union in46_addr dst;
                        uint8_t dst_len;
-                       union if_addr gateway;
+                       union in46_addr gateway;
                } rt;
                struct {
-                       union if_addr dst;
+                       union in46_addr dst;
                        uint16_t state;
                        uint8_t flags;
                } neigh;
@@ -137,7 +137,7 @@ struct netevent_handler_info {
                        struct odhcpd_ipaddr *addrs;
                        size_t len;
                } addrs_old;
-               union if_addr addr;
+               union in46_addr addr;
        };
 };
 
@@ -161,7 +161,7 @@ struct netevent_handler {
 };
 
 struct odhcpd_ipaddr {
-       union if_addr addr;
+       union in46_addr addr;
        uint8_t prefix;
        uint32_t preferred_lt;
        uint32_t valid_lt;