aboutsummaryrefslogtreecommitdiffstats
path: root/main/nfs-utils/0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch
blob: 2d4f61311461ba2fb4642a9b4697661dbaf2c01a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 0b4df13026eb371b68abc4b8cec4ca8d90c3b0a3 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 2 Jun 2014 14:42:10 +0200
Subject: [PATCH] exportfs: only do glibc specific hackery on glibc

We should not depend on the libc do free(3) on ai_canonname as that is
completely up to implementation and known o break things on uclibc and
musl libc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 support/export/hostname.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/support/export/hostname.c b/support/export/hostname.c
index d9153e1..30584b4 100644
--- a/support/export/hostname.c
+++ b/support/export/hostname.c
@@ -384,6 +384,7 @@
 
 	ai = host_pton(buf);
 
+#if !definded(__UCLIBC__) && defined(__GLIBC__)
 	/*
 	 * getaddrinfo(AI_NUMERICHOST) never fills in ai_canonname
 	 */
@@ -394,7 +395,9 @@
 			ai = NULL;
 		}
 	}
+#endif
 
 	return ai;
 }
+
 #endif	/* !HAVE_GETNAMEINFO */