libslirp: 4.9.0 -> 4.9.1

This commit is contained in:
R. Ryantm 2025-05-28 13:23:30 +00:00 committed by Weijia Wang
parent 0999540d8d
commit 6428b68ae5
2 changed files with 2 additions and 54 deletions

View File

@ -1,46 +0,0 @@
From 735904142f95d0500c0eae6bf763e4ad24b6b9fd Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Wed, 26 Mar 2025 08:42:35 +0100
Subject: [PATCH] apple: Fix getting IPv4 DNS server address when IPv4 and IPv4
are interleaved
When getting an IPv4 DNS server address, if libresolv returns
IPv4
IPv6
IPv4
IPv6
(or just IPv4 and IPv6)
we would still have found == 1 on the second iteration and thus take the
IPv6 even if it's not the proper af. We can as well just completely ignore
the non-matching af entries.
Fixes #85
---
src/slirp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/slirp.c b/src/slirp.c
index bccee53..62a018a 100644
--- a/src/slirp.c
+++ b/src/slirp.c
@@ -289,9 +289,12 @@ static int get_dns_addr_libresolv(int af, void *pdns_addr, void *cached_addr,
found = 0;
DEBUG_MISC("IP address of your DNS(s):");
for (int i = 0; i < count; i++) {
- if (af == servers[i].sin.sin_family) {
- found++;
+ if (af != servers[i].sin.sin_family) {
+ continue;
}
+
+ found++;
+
if (af == AF_INET) {
addr = &servers[i].sin.sin_addr;
} else { // af == AF_INET6
--
GitLab

View File

@ -10,22 +10,16 @@
stdenv.mkDerivation rec {
pname = "libslirp";
version = "4.9.0";
version = "4.9.1";
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "slirp";
repo = "libslirp";
rev = "v${version}";
sha256 = "sha256-Eqdw6epFkLv4Dnw/s1pcKW0P70ApZwx/J2VkCwn50Ew=";
sha256 = "sha256-MKP3iBExaPQryiahI1l/4bTgVht5Vu8AxaDyMotqmMo=";
};
patches = [
# https://gitlab.freedesktop.org/slirp/libslirp/-/commit/735904142f95d0500c0eae6bf763e4ad24b6b9fd
# Vendorized due to frequent instability of the upstream repository.
./fix-dns-for-darwin.patch
];
separateDebugInfo = true;
nativeBuildInputs = [