From 1856a585ae4290e666314ee7907dc8cbbb08fe2d Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 17 Jul 2025 21:32:12 +0200 Subject: ipcpd: Refactor ipcp main struct The ipcpi (IPCP instance) is now cleanly tucked away within its source file instead of exposed all over the place. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/udp/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/ipcpd/udp') diff --git a/src/ipcpd/udp/main.c b/src/ipcpd/udp/main.c index 2e8d84ce..3cfcf2cc 100644 --- a/src/ipcpd/udp/main.c +++ b/src/ipcpd/udp/main.c @@ -81,8 +81,6 @@ #define SENDTO_FLAGS 0 #endif -struct ipcp ipcpi; - /* Keep order for alignment. */ struct mgmt_msg { uint32_t eid; @@ -592,11 +590,9 @@ static int udp_ipcp_bootstrap(const struct ipcp_config * conf) char dnsstr[INET_ADDRSTRLEN]; int i = 1; - assert(conf); + assert(conf != NULL); assert(conf->type == THIS_TYPE); - - ipcpi.dir_hash_algo = HASH_MD5; - strcpy(ipcpi.layer_name, conf->layer_info.name); + assert(conf->layer_info.dir_hash_algo == (enum pol_dir_hash) HASH_MD5); if (inet4_ntop(&conf->udp.ip_addr, ipstr) == NULL) { log_err("Failed to convert IP address."); -- cgit v1.2.3