dhcpv4: move struct dhcpv4_dnr to header
authorDavid Härdeman <[email protected]>
Wed, 24 Sep 2025 13:27:27 +0000 (15:27 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Fri, 3 Oct 2025 10:53:56 +0000 (12:53 +0200)
This helps declutter dhcpv4.c a little bit.

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

index f7d93c4931d7e051bb0261a492fb89c0e53cb320..cf5a24480669b339dceee95cfd10b051f2d17fee 100644 (file)
@@ -318,14 +318,6 @@ static int dhcpv4_send_reply(const void *buf, size_t len,
        return sendto(*sock, buf, len, MSG_DONTWAIT, dest, dest_len);
 }
 
-/* DNR */
-struct dhcpv4_dnr {
-       uint16_t len;
-       uint16_t priority;
-       uint8_t adn_len;
-       uint8_t body[];
-};
-
 void dhcpv4_handle_msg(void *addr, void *data, size_t len,
                struct interface *iface, _unused void *dest_addr,
                send_reply_cb_t send_reply, void *opaque)
index f02529f4fa0fc4608f2da168838a5f83cf729e16..7db5c521ead42a6adb2a8f408cf65ffeb4eb419d 100644 (file)
@@ -97,6 +97,14 @@ struct dhcpv4_option {
        uint8_t data[];
 };
 
+/* DNR */
+struct dhcpv4_dnr {
+       uint16_t len;
+       uint16_t priority;
+       uint8_t adn_len;
+       uint8_t body[];
+};
+
 
 #define dhcpv4_for_each_option(start, end, opt)\
        for (opt = (struct dhcpv4_option*)(start); \