ubus: minor correctness fix
authorDavid Härdeman <[email protected]>
Sat, 4 Oct 2025 17:50:17 +0000 (19:50 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 7 Oct 2025 08:52:24 +0000 (10:52 +0200)
Now, blobmsg_close_table() and blobmsg_close_array() happen to be identical, so
the actual code doesn't change at all, but this still caused me some
headscratching when I first saw it.

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

index 82c580638a016040d56f49f03b39992d0a0c495a..13a74cc4fbd94c2ccb1c103707bbe344e9d9cec4 100644 (file)
@@ -161,7 +161,7 @@ static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct
 
                        m = blobmsg_open_array(&b, a->flags & OAF_DHCPV6_NA ? "ipv6-addr": "ipv6-prefix");
                        dhcpv6_ia_enum_addrs(iface, a, now, dhcpv6_blobmsg_ia_addr, NULL);
-                       blobmsg_close_table(&b, m);
+                       blobmsg_close_array(&b, m);
 
                        blobmsg_add_u32(&b, "valid", INFINITE_VALID(a->valid_until) ?
                                                (uint32_t)-1 : (uint32_t)(a->valid_until - now));