diff --git a/.libslirp.metadata b/.libslirp.metadata new file mode 100644 index 0000000..f08fac2 --- /dev/null +++ b/.libslirp.metadata @@ -0,0 +1 @@ +5ef4ed055299eab0703d4c49da552fdb61357f13 libslirp-4.4.0.tar.xz diff --git a/0002-Replace-inet_ntoa-with-safer-inet_ntop.patch b/0002-Replace-inet_ntoa-with-safer-inet_ntop.patch index 00dca1f..908b144 100644 --- a/0002-Replace-inet_ntoa-with-safer-inet_ntop.patch +++ b/0002-Replace-inet_ntoa-with-safer-inet_ntop.patch @@ -1,4 +1,4 @@ -From a2ef541ccf7899df63784da95526520d204ebc8b Mon Sep 17 00:00:00 2001 +From 849c972aa16a85c860f67d7e7f1fbe58e45187d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 9 Feb 2022 22:15:08 +0400 Subject: [PATCH 2/2] Replace inet_ntoa() with safer inet_ntop() @@ -14,8 +14,9 @@ Signed-off-by: Marc-André Lureau src/arp_table.c | 8 ++++++-- src/ip_icmp.c | 10 ++++++---- src/misc.c | 22 +++++++++++++--------- + src/socket.c | 5 +++-- src/udp.c | 5 +++-- - 4 files changed, 28 insertions(+), 17 deletions(-) + 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/arp_table.c b/src/arp_table.c index ba8c8a4eee88..3cf2ecc238bc 100644 @@ -124,6 +125,27 @@ index e6bc0a207d0b..1306f68eb539 100644 so->so_rcv.sb_cc, so->so_snd.sb_cc); } +diff --git a/src/socket.c b/src/socket.c +index c0b02ad131f3..6607e319ad6c 100644 +--- a/src/socket.c ++++ b/src/socket.c +@@ -743,13 +743,14 @@ struct socket *tcp_listen(Slirp *slirp, uint32_t haddr, unsigned hport, + struct sockaddr_in addr; + struct socket *so; + int s, opt = 1; ++ char inet_addr[INET_ADDRSTRLEN]; + socklen_t addrlen = sizeof(addr); + memset(&addr, 0, addrlen); + + DEBUG_CALL("tcp_listen"); +- DEBUG_ARG("haddr = %s", inet_ntoa((struct in_addr){ .s_addr = haddr })); ++ DEBUG_ARG("haddr = %s", inet_ntop(AF_INET, &(struct in_addr){ .s_addr = haddr }, inet_addr, sizeof(inet_addr))); + DEBUG_ARG("hport = %d", ntohs(hport)); +- DEBUG_ARG("laddr = %s", inet_ntoa((struct in_addr){ .s_addr = laddr })); ++ DEBUG_ARG("laddr = %s", inet_ntop(AF_INET, &(struct in_addr){ .s_addr = laddr }, inet_addr, sizeof(inet_addr))); + DEBUG_ARG("lport = %d", ntohs(lport)); + DEBUG_ARG("flags = %x", flags); + diff --git a/src/udp.c b/src/udp.c index e4578aa94ed5..0547cd6fc5c3 100644 --- a/src/udp.c diff --git a/libslirp.spec b/libslirp.spec index d0e2a00..e5e5776 100644 --- a/libslirp.spec +++ b/libslirp.spec @@ -1,6 +1,6 @@ Name: libslirp Version: 4.4.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A general purpose TCP-IP emulator # check the SPDX tags in source files for details @@ -63,6 +63,10 @@ developing applications that use %{name}. %changelog +* Fri Feb 11 2022 Jindrich Novy - 4.4.0-7 +- fix also socket.c, thanks to Marc-André Lureau +- Related: #2000051 + * Fri Feb 11 2022 Jindrich Novy - 4.4.0-6 - add patches fixing gating tests from Marc-André Lureau - Related: #2000051