From 8ffe79e3f08691335e37548bfa92d9aaa9b2134e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 13 Nov 2025 11:28:12 +0100 Subject: [PATCH] src: improve attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Properly guard odhcp6c.h attributes with `#ifndef` to avoid redefining them when including external headers. - Also convert the remaining __attribute__ usages to the custom declarations. - Consolidate custom declarations with _o_ prefix. Signed-off-by: Álvaro Fernández Rojas Link: https://github.com/openwrt/odhcpd/pull/307 --- src/config.c | 10 +++++----- src/dhcpv4.c | 4 ++-- src/dhcpv4.h | 6 +++--- src/dhcpv6-ia.c | 12 ++++++------ src/dhcpv6-pxe.c | 2 +- src/dhcpv6.c | 20 ++++++++++---------- src/dhcpv6.h | 14 +++++++------- src/ndp.c | 6 +++--- src/netlink.c | 20 ++++++++++---------- src/odhcpd.c | 4 ++-- src/odhcpd.h | 17 +++++++++++++---- src/router.c | 2 +- src/statefiles.c | 6 +++--- src/ubus.c | 38 +++++++++++++++++++------------------- 14 files changed, 85 insertions(+), 76 deletions(-) diff --git a/src/config.c b/src/config.c index 27ab531..9246d64 100644 --- a/src/config.c +++ b/src/config.c @@ -1016,7 +1016,7 @@ static int parse_dnr_str(char *str, struct interface *iface) error("Invalid value '%s' for SvcParam 'port'", svc_val_str); goto err; } - _fallthrough; + _o_fallthrough; case DNR_SVC_DOHPATH: /* plain string */ @@ -1065,7 +1065,7 @@ err: return -1; } -static int avl_ipv4_cmp(const void *k1, const void *k2, _unused void *ptr) +static int avl_ipv4_cmp(const void *k1, const void *k2, _o_unused void *ptr) { return memcmp(k1, k2, sizeof(struct in_addr)); } @@ -1733,7 +1733,7 @@ static void lease_cfg_update_leases(struct lease_cfg *lease_cfg) } } -static int lease_cfg_cmp(const void *k1, const void *k2, _unused void *ptr) +static int lease_cfg_cmp(const void *k1, const void *k2, _o_unused void *ptr) { const struct lease_cfg *lease_cfg1 = k1, *lease_cfg2 = k2; int cmp = 0; @@ -1810,7 +1810,7 @@ static void lease_cfg_delete(struct lease_cfg *lease_cfg) free_lease_cfg(lease_cfg); } -static void lease_cfg_update(_unused struct vlist_tree *tree, struct vlist_node *node_new, +static void lease_cfg_update(_o_unused struct vlist_tree *tree, struct vlist_node *node_new, struct vlist_node *node_old) { struct lease_cfg *lease_cfg_new = container_of(node_new, struct lease_cfg, node); @@ -2443,7 +2443,7 @@ static void handle_signal(int signal) uloop_end(); } -static void reload_cb(struct uloop_fd *u, _unused unsigned int events) +static void reload_cb(struct uloop_fd *u, _o_unused unsigned int events) { char b[512]; if (read(u->fd, b, sizeof(b)) < 0) {} diff --git a/src/dhcpv4.c b/src/dhcpv4.c index 2229197..ba82559 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -774,7 +774,7 @@ enum { }; void dhcpv4_handle_msg(void *src_addr, void *data, size_t len, - struct interface *iface, _unused void *our_dest_addr, + struct interface *iface, _o_unused void *our_dest_addr, send_reply_cb_t send_reply, void *opaque) { /* Request variables */ @@ -1319,7 +1319,7 @@ void dhcpv4_handle_msg(void *src_addr, void *data, size_t len, /* Handler for DHCPv4 messages */ static void dhcpv4_handle_dgram(void *addr, void *data, size_t len, - struct interface *iface, _unused void *dest_addr) + struct interface *iface, _o_unused void *dest_addr) { int sock = iface->dhcpv4_event.uloop.fd; diff --git a/src/dhcpv4.h b/src/dhcpv4.h index c120f7f..d2b31a3 100644 --- a/src/dhcpv4.h +++ b/src/dhcpv4.h @@ -101,7 +101,7 @@ struct dhcpv4_message { char file[128]; uint32_t cookie; uint8_t options[]; -} _packed; +} _o_packed; // RFC2131, §3 #define DHCPV4_MAGIC_COOKIE 0x63825363 @@ -114,7 +114,7 @@ struct dhcpv4_auth_forcerenew { uint32_t replay[2]; uint8_t type; uint8_t key[16]; -} _packed; +} _o_packed; // https://www.iana.org/assignments/auth-namespaces/auth-namespaces.xhtml#auth-namespaces-1 enum dhcpv4_auth_protocol { @@ -164,7 +164,7 @@ struct dhcpv4_option_u32 { uint8_t code; uint8_t len; uint32_t data; -} _packed; +} _o_packed; /* DNR */ struct dhcpv4_dnr { diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index 4b11b57..dd46a14 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -166,7 +166,7 @@ static int send_reconf(struct dhcpv6_lease *assign) uint16_t code; uint16_t len; uint8_t data[DUID_MAX_LEN]; - } _packed serverid = { + } _o_packed serverid = { .code = htons(DHCPV6_OPT_SERVERID), .len = 0, .data = { 0 }, @@ -175,7 +175,7 @@ static int send_reconf(struct dhcpv6_lease *assign) uint16_t code; uint16_t len; uint8_t data[DUID_MAX_LEN]; - } _packed clientid = { + } _o_packed clientid = { .code = htons(DHCPV6_OPT_CLIENTID), .len = htons(assign->duid_len), .data = { 0 }, @@ -184,7 +184,7 @@ static int send_reconf(struct dhcpv6_lease *assign) uint16_t code; uint16_t len; uint8_t id; - } _packed message = { + } _o_packed message = { .code = htons(DHCPV6_OPT_RECONF_MSG), .len = htons(1), .id = DHCPV6_MSG_RENEW, @@ -574,7 +574,7 @@ static size_t build_ia(uint8_t *buf, size_t buflen, uint16_t status, return 0; if (status) { - struct __attribute__((packed)) { + struct _o_packed { uint16_t type; uint16_t len; uint16_t val; @@ -820,8 +820,8 @@ struct log_ctxt { int buf_idx; }; -static void dhcpv6_log_ia_addr(_unused struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix, - _unused uint32_t pref_lt, _unused uint32_t valid_lt, void *arg) +static void dhcpv6_log_ia_addr(_o_unused struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix, + _o_unused uint32_t pref_lt, _o_unused uint32_t valid_lt, void *arg) { struct log_ctxt *ctxt = (struct log_ctxt *)arg; char addrbuf[INET6_ADDRSTRLEN]; diff --git a/src/dhcpv6-pxe.c b/src/dhcpv6-pxe.c index 10f82dc..58d8466 100644 --- a/src/dhcpv6-pxe.c +++ b/src/dhcpv6-pxe.c @@ -11,7 +11,7 @@ struct ipv6_pxe_entry { uint32_t arch; // Ready to send - struct __attribute__((packed)) { + struct _o_packed { uint16_t type; // In network endianess uint16_t len; // In network endianess, without /0 char payload[]; // Null-terminated here diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 223c8a3..a808400 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -257,8 +257,8 @@ struct dhcpv4_msg_data { }; static ssize_t dhcpv6_4o6_send_reply(struct iovec *iov, size_t iov_len, - _unused struct sockaddr *dest, - _unused socklen_t dest_len, + _o_unused struct sockaddr *dest, + _o_unused socklen_t dest_len, void *opaque) { struct dhcpv4_msg_data *reply = opaque; @@ -363,7 +363,7 @@ static void handle_client_request(void *addr, void *data, size_t len, debug("Got a DHCPv6-request on %s", iface->name); /* Construct reply message */ - struct _packed { + struct _o_packed { uint8_t msg_type; uint8_t tr_id[3]; uint16_t serverid_type; @@ -386,7 +386,7 @@ static void handle_client_request(void *addr, void *data, size_t len, dest.serverid_length = htons(sizeof(duid_ll_hdr) + ETH_ALEN); } - struct _packed { + struct _o_packed { uint16_t type; uint16_t len; uint8_t buf[DUID_MAX_LEN]; @@ -396,26 +396,26 @@ static void handle_client_request(void *addr, void *data, size_t len, .buf = { 0 }, }; - struct __attribute__((packed)) { + struct _o_packed { uint16_t type; uint16_t len; uint32_t value; } maxrt = {htons(DHCPV6_OPT_SOL_MAX_RT), htons(sizeof(maxrt) - 4), htonl(60)}; - struct __attribute__((packed)) { + struct _o_packed { uint16_t type; uint16_t len; } rapid_commit = {htons(DHCPV6_OPT_RAPID_COMMIT), 0}; - struct __attribute__((packed)) { + struct _o_packed { uint16_t type; uint16_t len; uint16_t value; } stat = {htons(DHCPV6_OPT_STATUS), htons(sizeof(stat) - 4), htons(DHCPV6_STATUS_USEMULTICAST)}; - struct __attribute__((packed)) { + struct _o_packed { uint16_t type; uint16_t len; uint32_t value; @@ -614,7 +614,7 @@ static void handle_client_request(void *addr, void *data, size_t len, } search = {htons(DHCPV6_OPT_DNS_DOMAIN), htons(search_len)}; - struct __attribute__((packed)) dhcpv4o6_server { + struct _o_packed dhcpv4o6_server { uint16_t type; uint16_t len; struct in6_addr addr; @@ -733,7 +733,7 @@ static void handle_client_request(void *addr, void *data, size_t len, #ifdef DHCPV4_SUPPORT if (hdr->msg_type == DHCPV6_MSG_DHCPV4_QUERY) { - struct _packed dhcpv4_msg_data { + struct _o_packed dhcpv4_msg_data { uint16_t type; uint16_t len; uint8_t msg[1]; diff --git a/src/dhcpv6.h b/src/dhcpv6.h index af175c9..7aed782 100644 --- a/src/dhcpv6.h +++ b/src/dhcpv6.h @@ -98,7 +98,7 @@ struct dhcpv6_client_header { uint8_t msg_type; uint8_t transaction_id[3]; -} __attribute__((packed)); +} _o_packed; struct dhcpv6_relay_header { uint8_t msg_type; @@ -106,7 +106,7 @@ struct dhcpv6_relay_header { struct in6_addr link_address; struct in6_addr peer_address; uint8_t options[]; -} __attribute__((packed)); +} _o_packed; struct dhcpv6_relay_forward_envelope { uint8_t msg_type; @@ -118,7 +118,7 @@ struct dhcpv6_relay_forward_envelope { uint32_t interface_id_data; uint16_t relay_message_type; uint16_t relay_message_len; -} __attribute__((packed)); +} _o_packed; struct dhcpv6_auth_reconfigure { uint16_t type; @@ -129,7 +129,7 @@ struct dhcpv6_auth_reconfigure { uint32_t replay[2]; uint8_t reconf_type; uint8_t key[16]; -} _packed; +} _o_packed; struct dhcpv6_ia_hdr { uint16_t type; @@ -137,7 +137,7 @@ struct dhcpv6_ia_hdr { uint32_t iaid; uint32_t t1; uint32_t t2; -} _packed; +} _o_packed; struct dhcpv6_ia_prefix { uint16_t type; @@ -146,7 +146,7 @@ struct dhcpv6_ia_prefix { uint32_t valid_lt; uint8_t prefix; struct in6_addr addr; -} _packed; +} _o_packed; struct dhcpv6_ia_addr { uint16_t type; @@ -154,7 +154,7 @@ struct dhcpv6_ia_addr { struct in6_addr addr; uint32_t preferred_lt; uint32_t valid_lt; -} _packed; +} _o_packed; struct dhcpv6_cer_id { uint16_t type; diff --git a/src/ndp.c b/src/ndp.c index 6924602..d8bc248 100644 --- a/src/ndp.c +++ b/src/ndp.c @@ -244,13 +244,13 @@ static void ndp_netevent_cb(unsigned long event, struct netevent_handler_info *i case NETEV_ADDR6_DEL: add = false; netlink_dump_neigh_table(false); - _fallthrough; + _o_fallthrough; case NETEV_ADDR6_ADD: setup_addr_for_relaying(&info->addr.in6, iface, add); break; case NETEV_NEIGH6_DEL: add = false; - _fallthrough; + _o_fallthrough; case NETEV_NEIGH6_ADD: if (info->neigh.flags & NTF_PROXY) { if (add) { @@ -328,7 +328,7 @@ static void send_na(struct in6_addr *to_addr, /* Handle solicitations */ static void handle_solicit(void *addr, void *data, size_t len, - struct interface *iface, _unused void *dest) + struct interface *iface, _o_unused void *dest) { struct ip6_hdr *ip6 = data; struct nd_neighbor_solicit *req = (struct nd_neighbor_solicit*)&ip6[1]; diff --git a/src/netlink.c b/src/netlink.c index 9ef1a28..48e27d0 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -439,7 +439,7 @@ static int handle_rtm_neigh(struct nlmsghdr *hdr, bool add) /* Handler for neighbor cache entries from the kernel. This is our source * to learn and unlearn hosts on interfaces. */ -static int cb_rtnl_valid(struct nl_msg *msg, _unused void *arg) +static int cb_rtnl_valid(struct nl_msg *msg, _o_unused void *arg) { struct nlmsghdr *hdr = nlmsg_hdr(msg); int ret = NL_SKIP; @@ -452,21 +452,21 @@ static int cb_rtnl_valid(struct nl_msg *msg, _unused void *arg) case RTM_NEWROUTE: add = true; - _fallthrough; + _o_fallthrough; case RTM_DELROUTE: ret = handle_rtm_route(hdr, add); break; case RTM_NEWADDR: add = true; - _fallthrough; + _o_fallthrough; case RTM_DELADDR: ret = handle_rtm_addr(hdr, add); break; case RTM_NEWNEIGH: add = true; - _fallthrough; + _o_fallthrough; case RTM_DELNEIGH: ret = handle_rtm_neigh(hdr, add); break; @@ -599,7 +599,7 @@ static int cb_addr_valid(struct nl_msg *msg, void *arg) } -static int cb_addr_finish(_unused struct nl_msg *msg, void *arg) +static int cb_addr_finish(_o_unused struct nl_msg *msg, void *arg) { struct addr_info *ctxt = (struct addr_info *)arg; @@ -609,7 +609,7 @@ static int cb_addr_finish(_unused struct nl_msg *msg, void *arg) } -static int cb_addr_error(_unused struct sockaddr_nl *nla, struct nlmsgerr *err, +static int cb_addr_error(_o_unused struct sockaddr_nl *nla, struct nlmsgerr *err, void *arg) { struct addr_info *ctxt = (struct addr_info *)arg; @@ -770,7 +770,7 @@ static int cb_linklocal_valid(struct nl_msg *msg, void *arg) } -static int cb_linklocal_finish(_unused struct nl_msg *msg, void *arg) +static int cb_linklocal_finish(_o_unused struct nl_msg *msg, void *arg) { struct addr_info *ctxt = (struct addr_info *)arg; @@ -780,7 +780,7 @@ static int cb_linklocal_finish(_unused struct nl_msg *msg, void *arg) } -static int cb_linklocal_error(_unused struct sockaddr_nl *nla, struct nlmsgerr *err, +static int cb_linklocal_error(_o_unused struct sockaddr_nl *nla, struct nlmsgerr *err, void *arg) { struct addr_info *ctxt = (struct addr_info *)arg; @@ -886,7 +886,7 @@ static int cb_proxy_neigh_valid(struct nl_msg *msg, void *arg) } -static int cb_proxy_neigh_finish(_unused struct nl_msg *msg, void *arg) +static int cb_proxy_neigh_finish(_o_unused struct nl_msg *msg, void *arg) { struct neigh_info *ctxt = (struct neigh_info *)arg; @@ -896,7 +896,7 @@ static int cb_proxy_neigh_finish(_unused struct nl_msg *msg, void *arg) } -static int cb_proxy_neigh_error(_unused struct sockaddr_nl *nla, struct nlmsgerr *err, +static int cb_proxy_neigh_error(_o_unused struct sockaddr_nl *nla, struct nlmsgerr *err, void *arg) { struct neigh_info *ctxt = (struct neigh_info *)arg; diff --git a/src/odhcpd.c b/src/odhcpd.c index d41e4cd..1f2417b 100644 --- a/src/odhcpd.c +++ b/src/odhcpd.c @@ -67,7 +67,7 @@ void __iflog(int lvl, const char *fmt, ...) va_end(ap); } -static void sighandler(_unused int signal) +static void sighandler(_o_unused int signal) { uloop_end(); } @@ -420,7 +420,7 @@ struct interface* odhcpd_get_interface_by_index(int ifindex) } /* Convenience function to receive and do basic validation of packets */ -static void odhcpd_receive_packets(struct uloop_fd *u, _unused unsigned int events) +static void odhcpd_receive_packets(struct uloop_fd *u, _o_unused unsigned int events) { struct odhcpd_event *e = container_of(u, struct odhcpd_event, uloop); diff --git a/src/odhcpd.h b/src/odhcpd.h index 5daf510..eadb0fc 100644 --- a/src/odhcpd.h +++ b/src/odhcpd.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -52,9 +53,17 @@ #define INFINITE_VALID(x) ((x) == 0) -#define _unused __attribute__((unused)) -#define _packed __attribute__((packed)) -#define _fallthrough __attribute__((__fallthrough__)) +#ifndef _o_fallthrough +#define _o_fallthrough __attribute__((__fallthrough__)) +#endif /* _o_fallthrough */ + +#ifndef _o_packed +#define _o_packed __attribute__((packed)) +#endif /* _o_packed */ + +#ifndef _o_unused +#define _o_unused __attribute__((unused)) +#endif /* _o_unused */ #define ALL_IPV6_NODES "ff02::1" #define ALL_IPV6_ROUTERS "ff02::2" @@ -616,7 +625,7 @@ int dhcpv4_init(void); void dhcpv4_free_lease(struct dhcpv4_lease *a); int dhcpv4_setup_interface(struct interface *iface, bool enable); void dhcpv4_handle_msg(void *addr, void *data, size_t len, - struct interface *iface, _unused void *dest_addr, + struct interface *iface, _o_unused void *dest_addr, send_reply_cb_t send_reply, void *opaque); #else static inline void dhcpv4_free_lease(struct dhcpv4_lease *lease) { diff --git a/src/router.c b/src/router.c index 621a0cd..c71ad98 100644 --- a/src/router.c +++ b/src/router.c @@ -1052,7 +1052,7 @@ static void trigger_router_advert(struct uloop_timeout *event) /* Event handler for incoming ICMPv6 packets */ static void handle_icmpv6(void *addr, void *data, size_t len, - struct interface *iface, _unused void *dest) + struct interface *iface, _o_unused void *dest) { struct icmp6_hdr *hdr = data; struct sockaddr_in6 *from = addr; diff --git a/src/statefiles.c b/src/statefiles.c index 65920d2..ed45f55 100644 --- a/src/statefiles.c +++ b/src/statefiles.c @@ -68,8 +68,8 @@ static bool statefiles_write_host6(struct write_ctxt *ctxt, struct dhcpv6_lease return true; } -static void statefiles_write_host6_cb(struct dhcpv6_lease *lease, struct in6_addr *addr, _unused int prefix, - _unused uint32_t pref_lt, _unused uint32_t valid_lt, void *arg) +static void statefiles_write_host6_cb(struct dhcpv6_lease *lease, struct in6_addr *addr, _o_unused int prefix, + _o_unused uint32_t pref_lt, _o_unused uint32_t valid_lt, void *arg) { struct write_ctxt *ctxt = (struct write_ctxt *)arg; @@ -162,7 +162,7 @@ err: } static void statefiles_write_state6_addr(struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix, - _unused uint32_t pref_lt, _unused uint32_t valid_lt, void *arg) + _o_unused uint32_t pref_lt, _o_unused uint32_t valid_lt, void *arg) { struct write_ctxt *ctxt = (struct write_ctxt *)arg; char ipbuf[INET6_ADDRSTRLEN]; diff --git a/src/ubus.c b/src/ubus.c index bc8e456..9e51622 100644 --- a/src/ubus.c +++ b/src/ubus.c @@ -19,9 +19,9 @@ static uint32_t objid = 0; static struct ubus_request req_dump = { .list = LIST_HEAD_INIT(req_dump.list) }; #ifdef DHCPV4_SUPPORT -static int handle_dhcpv4_leases(struct ubus_context *ctx, _unused struct ubus_object *obj, - struct ubus_request_data *req, _unused const char *method, - _unused struct blob_attr *msg) +static int handle_dhcpv4_leases(struct ubus_context *ctx, _o_unused struct ubus_object *obj, + struct ubus_request_data *req, _o_unused const char *method, + _o_unused struct blob_attr *msg) { struct interface *iface; time_t now = odhcpd_time(); @@ -90,8 +90,8 @@ static int handle_dhcpv4_leases(struct ubus_context *ctx, _unused struct ubus_ob } #endif /* DHCPV4_SUPPORT */ -static void dhcpv6_blobmsg_ia_addr(_unused struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix, - uint32_t pref_lt, uint32_t valid_lt, _unused void *arg) +static void dhcpv6_blobmsg_ia_addr(_o_unused struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix, + uint32_t pref_lt, uint32_t valid_lt, _o_unused void *arg) { void *a = blobmsg_open_table(&b, NULL); char *buf = blobmsg_alloc_string_buffer(&b, "address", INET6_ADDRSTRLEN); @@ -109,9 +109,9 @@ static void dhcpv6_blobmsg_ia_addr(_unused struct dhcpv6_lease *lease, struct in blobmsg_close_table(&b, a); } -static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct ubus_object *obj, - _unused struct ubus_request_data *req, _unused const char *method, - _unused struct blob_attr *msg) +static int handle_dhcpv6_leases(_o_unused struct ubus_context *ctx, _o_unused struct ubus_object *obj, + _o_unused struct ubus_request_data *req, _o_unused const char *method, + _o_unused struct blob_attr *msg) { struct interface *iface; time_t now = odhcpd_time(); @@ -177,9 +177,9 @@ static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct return 0; } -static int handle_ra_pio(_unused struct ubus_context *ctx, _unused struct ubus_object *obj, - _unused struct ubus_request_data *req, _unused const char *method, - _unused struct blob_attr *msg) +static int handle_ra_pio(_o_unused struct ubus_context *ctx, _o_unused struct ubus_object *obj, + _o_unused struct ubus_request_data *req, _o_unused const char *method, + _o_unused struct blob_attr *msg) { char ipv6_str[INET6_ADDRSTRLEN]; time_t now = odhcpd_time(); @@ -233,8 +233,8 @@ static int handle_ra_pio(_unused struct ubus_context *ctx, _unused struct ubus_o return 0; } -static int handle_add_lease_cfg(_unused struct ubus_context *ctx, _unused struct ubus_object *obj, - _unused struct ubus_request_data *req, _unused const char *method, +static int handle_add_lease_cfg(_o_unused struct ubus_context *ctx, _o_unused struct ubus_object *obj, + _o_unused struct ubus_request_data *req, _o_unused const char *method, struct blob_attr *msg) { if (!config_set_lease_cfg_from_blobmsg(msg)) @@ -292,7 +292,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = { [IFACE_ATTR_ADDRESS] = { .name = "ipv6-address", .type = BLOBMSG_TYPE_ARRAY }, }; -static void handle_dump(_unused struct ubus_request *req, _unused int type, struct blob_attr *msg) +static void handle_dump(_o_unused struct ubus_request *req, _o_unused int type, struct blob_attr *msg) { struct blob_attr *tb[DUMP_ATTR_MAX]; blobmsg_parse(dump_attrs, DUMP_ATTR_MAX, tb, blob_data(msg), blob_len(msg)); @@ -321,8 +321,8 @@ static void update_netifd(bool subscribe) } -static int handle_update(_unused struct ubus_context *ctx, _unused struct ubus_object *obj, - _unused struct ubus_request_data *req, _unused const char *method, +static int handle_update(_o_unused struct ubus_context *ctx, _o_unused struct ubus_object *obj, + _o_unused struct ubus_request_data *req, _o_unused const char *method, struct blob_attr *msg) { struct blob_attr *tb[IFACE_ATTR_MAX]; @@ -423,9 +423,9 @@ void ubus_bcast_dhcpv4_event(const char *type, const char *iface, ubus_notify(ubus, &main_object, type, b.head, -1); } -static void handle_event(_unused struct ubus_context *ctx, - _unused struct ubus_event_handler *ev, - _unused const char *type, struct blob_attr *msg) +static void handle_event(_o_unused struct ubus_context *ctx, + _o_unused struct ubus_event_handler *ev, + _o_unused const char *type, struct blob_attr *msg) { struct blob_attr *tb[OBJ_ATTR_MAX]; blobmsg_parse(obj_attrs, OBJ_ATTR_MAX, tb, blob_data(msg), blob_len(msg)); -- 2.30.2