Hi Rob,
Sorry for the delay, but here is an updated patch that includes the
GETHOSTBYADDR check.
-Phil
Phil Carns wrote:
rev-lookup-hostnames-runtime.patch:
----------------------
Can you tweak this so that the check for HAVE_GETHOSTBYADDR is
retained? I know it's a pain, and I can't remember the specifics
right now, but we probably need that check for BGL.
==rob
Ahh, sure thing. The version of PVFS2 that I implemented this on didn't
have the HAVE_GETHOSTBYADDR check yet. I'll add that in and get back to
you.
-Phil
_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
diff -Naur pvfs2-orig/configure.in pvfs2/configure.in
--- pvfs2-orig/configure.in 2006-06-28 17:44:14.000000000 +0200
+++ pvfs2/configure.in 2006-07-06 16:18:22.000000000 +0200
@@ -562,12 +562,6 @@
test_for_epoll
])
-dnl enable resolving addresses all the way to hostnames in bmi reverse lookup
-AC_ARG_ENABLE(rev-hostname,
-[ --enable-rev-hostname Enables hostname resolution in BMI reverse lookups],
-CFLAGS="$CFLAGS -D__PVFS2_BMI_REV_LOOKUP_HOSTNAME__"
-,)
-
dnl enables a hack to print back traces out of segfault signal handler
AC_ARG_ENABLE(segv-backtrace,
[ --enable-segv-backtrace Enables back traces in segfault signal handler],
diff -Naur pvfs2-orig/include/pvfs2-debug.h pvfs2/include/pvfs2-debug.h
--- pvfs2-orig/include/pvfs2-debug.h 2006-06-05 21:57:25.000000000 +0200
+++ pvfs2/include/pvfs2-debug.h 2006-07-06 16:19:25.000000000 +0200
@@ -66,6 +66,7 @@
#define GOSSIP_STATE_MACHINE_DEBUG ((uint64_t)1 << 44)
#define GOSSIP_DBPF_KEYVAL_DEBUG ((uint64_t)1 << 45)
#define GOSSIP_DBPF_COALESCE_DEBUG ((uint64_t)1 << 46)
+#define GOSSIP_ACCESS_HOSTNAMES ((uint64_t)1 << 47)
/* NOTE: if you want your gossip flag to be controlable from
* pvfs2-set-debugmask you have to add it in
diff -Naur pvfs2-orig/src/common/misc/pvfs2-debug.c pvfs2/src/common/misc/pvfs2-debug.c
--- pvfs2-orig/src/common/misc/pvfs2-debug.c 2006-06-23 22:59:28.000000000 +0200
+++ pvfs2/src/common/misc/pvfs2-debug.c 2006-07-06 16:20:04.000000000 +0200
@@ -33,7 +33,7 @@
GOSSIP_SETEATTR_DEBUG | GOSSIP_GETEATTR_DEBUG | \
GOSSIP_LISTEATTR_DEBUG | GOSSIP_DBPF_KEYVAL_DEBUG | \
GOSSIP_ACCESS_DEBUG | GOSSIP_ACCESS_DETAIL_DEBUG | \
-GOSSIP_PERFCOUNTER_DEBUG)
+GOSSIP_PERFCOUNTER_DEBUG | GOSSIP_ACCESS_HOSTNAMES)
/* map all config keywords to pvfs2 debug masks here */
static __keyword_mask_t s_keyword_mask_map[] =
@@ -76,6 +76,7 @@
{ "sm", GOSSIP_STATE_MACHINE_DEBUG },
{ "keyval", GOSSIP_DBPF_KEYVAL_DEBUG },
{ "coalesce", GOSSIP_DBPF_COALESCE_DEBUG },
+ { "access_hostnames", GOSSIP_ACCESS_HOSTNAMES },
{ "verbose", (__DEBUG_ALL & ~GOSSIP_PERFCOUNTER_DEBUG)},
{ "none", GOSSIP_NO_DEBUG },
{ "all", __DEBUG_ALL }
diff -Naur pvfs2-orig/src/io/bmi/bmi_tcp/bmi-tcp.c pvfs2/src/io/bmi/bmi_tcp/bmi-tcp.c
--- pvfs2-orig/src/io/bmi/bmi_tcp/bmi-tcp.c 2006-05-30 06:53:26.000000000 +0200
+++ pvfs2/src/io/bmi/bmi_tcp/bmi-tcp.c 2006-07-06 16:23:11.000000000 +0200
@@ -1514,11 +1514,26 @@
const char* BMI_tcp_addr_rev_lookup_unexpected(method_addr_p map)
{
struct tcp_addr *tcp_addr_data = map->method_data;
+ int debug_on;
+ uint64_t mask;
-#if !defined(__PVFS2_BMI_REV_LOOKUP_HOSTNAME__) || !defined(HAVE_GETHOSTBYADDR)
+ /* return default response if we don't have support for the right socket
+ * calls
+ */
+#if !defined(HAVE_GETHOSTBYADDR)
return(tcp_addr_data->peer);
-
#else
+
+ /* Only resolve hostnames if a gossip mask is set to request it.
+ * Otherwise we leave it at ip address
+ */
+ gossip_get_debug_mask(&debug_on, &mask);
+
+ if(!debug_on || (!(mask & GOSSIP_ACCESS_HOSTNAMES)))
+ {
+ return(tcp_addr_data->peer);
+ }
+
socklen_t peerlen = sizeof(struct sockaddr_in);
struct sockaddr_in peer;
int ret;
_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers