|
|
cb6f08 |
From 4097c1b862eb59f7110d097df7f719d00869191d Mon Sep 17 00:00:00 2001
|
|
|
cb6f08 |
Message-Id: <4097c1b862eb59f7110d097df7f719d00869191d.1624267112.git.davide.caratti@gmail.com>
|
|
|
cb6f08 |
From: Davide Caratti <davide.caratti@gmail.com>
|
|
|
cb6f08 |
Date: Wed, 16 Jun 2021 21:22:15 +0200
|
|
|
cb6f08 |
Subject: [PATCH 1/2] examples: avoid using inet_ntoa()
|
|
|
cb6f08 |
|
|
|
cb6f08 |
---
|
|
|
cb6f08 |
examples/https-server-test.c | 5 +++--
|
|
|
cb6f08 |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
cb6f08 |
|
|
|
cb6f08 |
diff --git a/examples/https-server-test.c b/examples/https-server-test.c
|
|
|
cb6f08 |
index 6362722..b626fd2 100644
|
|
|
cb6f08 |
--- a/examples/https-server-test.c
|
|
|
cb6f08 |
+++ b/examples/https-server-test.c
|
|
|
cb6f08 |
@@ -199,12 +199,13 @@ int main(int argc, char *argv[])
|
|
|
cb6f08 |
https_tls_ready, https_tls_disconnected, NULL);
|
|
|
cb6f08 |
|
|
|
cb6f08 |
if (getenv("TLS_DEBUG")) {
|
|
|
cb6f08 |
+ char buf[INET_ADDRSTRLEN];
|
|
|
cb6f08 |
char *str;
|
|
|
cb6f08 |
|
|
|
cb6f08 |
l_tls_set_debug(tls, https_tls_debug_cb, NULL, NULL);
|
|
|
cb6f08 |
|
|
|
cb6f08 |
- str = l_strdup_printf("/tmp/ell-certchain-%s.pem",
|
|
|
cb6f08 |
- inet_ntoa(client_addr.sin_addr));
|
|
|
cb6f08 |
+ inet_ntop(AF_INET,&client_addr.sin_addr, buf, INET_ADDRSTRLEN);
|
|
|
cb6f08 |
+ str = l_strdup_printf("/tmp/ell-certchain-%s.pem", buf);
|
|
|
cb6f08 |
l_tls_set_cert_dump_path(tls, str);
|
|
|
cb6f08 |
l_free(str);
|
|
|
cb6f08 |
}
|
|
|
cb6f08 |
--
|
|
|
cb6f08 |
2.31.1
|
|
|
cb6f08 |
|