summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2019-08-26 11:18:08 +0200
committerSander Vrijders <sander@ouroboros.rocks>2019-08-31 12:17:33 +0200
commit344dbad87ae8026415df5a652d7910f35557a700 (patch)
tree842f0da8c82e57324d909d6dbfce2ad54d2534ef
parentc1852e9a7140d69f8d308b3463fc1ec1159761ef (diff)
downloadouroboros-344dbad87ae8026415df5a652d7910f35557a700.tar.gz
ouroboros-344dbad87ae8026415df5a652d7910f35557a700.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r--src/ipcpd/udp/main.c4
1 files changed, 1 insertions, 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) {