On 16/04/2012 15:22, Alexander Komyagin wrote:
Hi, Ed. Which version of uclibc you are using?
I've spent a lot of time in that particular case with getaddrinfo(), and
as of 0.9.32 it behaves correctly. Make sure that this problem is really
related to resolving (try plain old sectioned printf debugging :) ).
Also try the attached patch to see if it helps.
Is this patch included in master? If not, can it be?
It's not a solution to my specific problem, but it seems like a good
performance fix and it got an ACK so I think it should get pulled?
Thanks
Ed W
>From 7208ecbcccbafce2a659dcd2d12659519906eba4 Mon Sep 17 00:00:00 2001
From: Alexander Komyagin <[email protected]>
Date: Wed, 4 Apr 2012 12:58:37 +0400
Subject: [PATCH] getaddrinfo(): avoid call to __check_pf() when not needed
__check_pf() function is called from getaddrinfo() and it calls
getifaddrs(), which is too much overhead especially if RSBAC-Net
is enabled. So with this patch __check_pf() is being called only
when AI_ADDRCONFIG hint flag is specified - just when we really
need that check.
Signed-off-by: Alexander Komyagin <[email protected]>
---
libc/inet/getaddrinfo.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
index e7511f6..4f9d0cd 100644
--- a/libc/inet/getaddrinfo.c
+++ b/libc/inet/getaddrinfo.c
@@ -401,7 +401,14 @@ gaih_inet(const char *name, const struct gaih_service *service,
int rc;
int v4mapped = (req->ai_family == PF_UNSPEC || req->ai_family == PF_INET6)
&& (req->ai_flags & AI_V4MAPPED);
- unsigned seen = __check_pf();
+
+ //"seen" variable won't be used if AI_ADDRCONFIG is
+ // not specified. So avoid unnecessary call to __check_pf()
+ // since it can be costly esp. when RSBAC-Net is enabled.
+ unsigned seen = 0;
+ if (req->ai_flags & AI_ADDRCONFIG) {
+ seen = __check_pf();
+ }
memset(&nullserv, 0, sizeof(nullserv));
--
1.7.1
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc