From 0124d754d2bcbb72483e08e3cf7670da2fa303e5 Mon Sep 17 00:00:00 2001 From: Bruce M Simpson Date: Thu, 12 Apr 2007 10:43:15 +0000 Subject: [PATCH] Fix nss_mdns when used from applications other than ssh. Bump PORTREVISION. --- dns/nss_mdns/Makefile | 2 +- dns/nss_mdns/files/patch-src__bsdnss.c | 46 ++++---------------------- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/dns/nss_mdns/Makefile b/dns/nss_mdns/Makefile index 3f79b0873abe..92f1431c5ffb 100644 --- a/dns/nss_mdns/Makefile +++ b/dns/nss_mdns/Makefile @@ -7,7 +7,7 @@ PORTNAME= nss_mdns PORTVERSION= 0.9 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= dns ipv6 MASTER_SITES= http://0pointer.de/lennart/projects/nss-mdns/ DISTNAME= nss-mdns-${PORTVERSION} diff --git a/dns/nss_mdns/files/patch-src__bsdnss.c b/dns/nss_mdns/files/patch-src__bsdnss.c index ac88bcb6a114..fbdb2b61f60d 100644 --- a/dns/nss_mdns/files/patch-src__bsdnss.c +++ b/dns/nss_mdns/files/patch-src__bsdnss.c @@ -1,6 +1,6 @@ ---- src/bsdnss.c.orig Sat Jan 20 17:38:27 2007 -+++ src/bsdnss.c Sat Jan 20 18:12:24 2007 -@@ -0,0 +1,462 @@ +--- src/bsdnss.c.orig Tue Apr 10 12:16:00 2007 ++++ src/bsdnss.c Tue Apr 10 12:21:42 2007 +@@ -0,0 +1,428 @@ +/* rcs tags go here when pushed upstream */ +/* Original author: Bruce M. Simpson */ + @@ -88,26 +88,6 @@ +extern enum nss_status _nss_mdns_gethostbyaddr_r (struct in_addr * addr, int len, int type, + struct hostent * result, char *buffer, + size_t buflen, int *errnop, int *h_errnop); -+extern enum nss_status _nss_mdns4_gethostbyname_r (const char *name, struct hostent * result, -+ char *buffer, size_t buflen, int *errnop, -+ int *h_errnop); -+ -+extern enum nss_status _nss_mdns4_gethostbyname2_r (const char *name, int af, struct hostent * result, -+ char *buffer, size_t buflen, int *errnop, -+ int *h_errnop); -+extern enum nss_status _nss_mdns4_gethostbyaddr_r (struct in_addr * addr, int len, int type, -+ struct hostent * result, char *buffer, -+ size_t buflen, int *errnop, int *h_errnop); -+extern enum nss_status _nss_mdns6_gethostbyname_r (const char *name, struct hostent * result, -+ char *buffer, size_t buflen, int *errnop, -+ int *h_errnop); -+ -+extern enum nss_status _nss_mdns6_gethostbyname2_r (const char *name, int af, struct hostent * result, -+ char *buffer, size_t buflen, int *errnop, -+ int *h_errnop); -+extern enum nss_status _nss_mdns6_gethostbyaddr_r (struct in_addr * addr, int len, int type, -+ struct hostent * result, char *buffer, -+ size_t buflen, int *errnop, int *h_errnop); + +typedef enum nss_status (*_bsd_nsstub_fn_t)(const char *, struct hostent *, char *, size_t, int *, int *); + @@ -213,26 +193,12 @@ + psa = (struct sockaddr *)(ai + 1); + + /* -+ * 1. Select which function to call based on the address family. ++ * 1. Call the nss_mdns internal gethostbyname function. + * 2. Map hostent to addrinfo. + * 3. Hand-off buffer to libc. + */ -+ switch (pai->ai_family) { -+ case AF_UNSPEC: -+ status = _nss_mdns_gethostbyname_r(name, hp, buffer, mbuflen, -+ &_errno, &_h_errno); -+ break; -+ case AF_INET: -+ status = _nss_mdns4_gethostbyname_r(name, hp, buffer, mbuflen, -+ &_errno, &_h_errno); -+ break; -+ case AF_INET6: -+ status = _nss_mdns6_gethostbyname_r(name, hp, buffer, mbuflen, -+ &_errno, &_h_errno); -+ break; -+ default: -+ break; -+ } ++ status = _nss_mdns_gethostbyname_r(name, hp, buffer, mbuflen, ++ &_errno, &_h_errno); + status = __nss_compat_result(status, _errno); + + if (status == NS_SUCCESS) {