From f51343d0af559ed0d00f4dc82b9d3d9e784eea23 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 13 Oct 2020 20:29:09 +0200 Subject: [PATCH] nspawn: pass userdata pointer, not inet_addr union Next patch will need to pass two pointers to the callback instead of just the addr mask. Caller will pass a compound structure, so make this 'void *userdata' to de-clutter the next patch. --- src/nspawn/nspawn-expose-ports.c | 6 +++--- src/nspawn/nspawn-expose-ports.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nspawn/nspawn-expose-ports.c b/src/nspawn/nspawn-expose-ports.c index d1e29d7b82..db076c50c0 100644 --- a/src/nspawn/nspawn-expose-ports.c +++ b/src/nspawn/nspawn-expose-ports.c @@ -188,7 +188,7 @@ int expose_port_watch_rtnl( sd_event *event, int recv_fd, sd_netlink_message_handler_t handler, - union in_addr_union *exposed, + void *userdata, sd_netlink **ret) { _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL; int fd, r; @@ -207,11 +207,11 @@ int expose_port_watch_rtnl( return log_error_errno(r, "Failed to create rtnl object: %m"); } - r = sd_netlink_add_match(rtnl, NULL, RTM_NEWADDR, handler, NULL, exposed, "nspawn-NEWADDR"); + r = sd_netlink_add_match(rtnl, NULL, RTM_NEWADDR, handler, NULL, userdata, "nspawn-NEWADDR"); if (r < 0) return log_error_errno(r, "Failed to subscribe to RTM_NEWADDR messages: %m"); - r = sd_netlink_add_match(rtnl, NULL, RTM_DELADDR, handler, NULL, exposed, "nspawn-DELADDR"); + r = sd_netlink_add_match(rtnl, NULL, RTM_DELADDR, handler, NULL, userdata, "nspawn-DELADDR"); if (r < 0) return log_error_errno(r, "Failed to subscribe to RTM_DELADDR messages: %m"); diff --git a/src/nspawn/nspawn-expose-ports.h b/src/nspawn/nspawn-expose-ports.h index cc834a4197..d0c1cecbe8 100644 --- a/src/nspawn/nspawn-expose-ports.h +++ b/src/nspawn/nspawn-expose-ports.h @@ -19,7 +19,7 @@ typedef struct ExposePort { void expose_port_free_all(ExposePort *p); int expose_port_parse(ExposePort **l, const char *s); -int expose_port_watch_rtnl(sd_event *event, int recv_fd, sd_netlink_message_handler_t handler, union in_addr_union *exposed, sd_netlink **ret); +int expose_port_watch_rtnl(sd_event *event, int recv_fd, sd_netlink_message_handler_t handler, void *userdata, sd_netlink **ret); int expose_port_send_rtnl(int send_fd); int expose_port_execute(sd_netlink *rtnl, ExposePort *l, union in_addr_union *exposed);