From 344dbad87ae8026415df5a652d7910f35557a700 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 26 Aug 2019 11:18:08 +0200 Subject: ipcpd: Remove duplicate ip address in udp data The ip address was stored twice, which is not needed. Only keeping the ip address in the sockaddr struct will make IPv6 support more homogeneous. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/udp/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ipcpd/udp/main.c b/src/ipcpd/udp/main.c index 08d44c8e..6383b5e5 100644 --- a/src/ipcpd/udp/main.c +++ b/src/ipcpd/udp/main.c @@ -110,7 +110,6 @@ struct uf { struct { struct shim_data * shim_data; - uint32_t ip_addr; uint32_t dns_addr; /* server socket */ struct sockaddr_in s_saddr; @@ -614,7 +613,6 @@ static int ipcp_udp_bootstrap(const struct ipcp_config * conf) goto fail_bind; } - udp_data.ip_addr = conf->ip_addr; udp_data.dns_addr = conf->dns_addr; udp_data.clt_port = htons(conf->clt_port); @@ -826,7 +824,7 @@ static int ipcp_udp_reg(const uint8_t * hash) dns_addr = udp_data.dns_addr; if (dns_addr != 0) { - ip_addr = udp_data.ip_addr; + ip_addr = udp_data.s_saddr.sin_addr.s_addr; if (inet_ntop(AF_INET, &ip_addr, ipstr, INET_ADDRSTRLEN) == NULL) { -- cgit v1.2.3