Skip to contentSkip to conversation

exportfs: replace one xlog(D_GENERAL) in host_canonname()

PATCH In review Scott Mayhew 2 participants 2 messages Apr 29, 2016 – May 2, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exportfs: replace one xlog(D_GENERAL) in host_canonname()

If we fall back to using the numeric host then we shouldn't call xlog with D_GENERAL. That can cause 'exportfs -u' to exit with a 1 if, for example, you have exports using ip addresses that can't be resolved to hostnames. Use D_PARSE instead.

---
 support/export/hostname.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/export/hostname.c +1 -1
index 94e98a5..5c4c824 100644
@@ -230,7 +230,7 @@ host_canonname(const struct sockaddr *sap)
 	default:
 		(void)getnameinfo(sap, salen, buf, (socklen_t)sizeof(buf),
 							NULL, 0, NI_NUMERICHOST);
-		xlog(D_GENERAL, "%s: failed to resolve %s: %s",
+		xlog(D_PARSE, "%s: failed to resolve %s: %s",
 				__func__, buf, gai_strerror(error));
 		return NULL;
 	}
Signature · 1 line
2.4.11
#1 lore raw
Quoted 6 lines · Scott Mayhew

If we fall back to using the numeric host then we shouldn't call xlog with D_GENERAL. That can cause 'exportfs -u' to exit with a 1 if, for example, you have exports using ip addresses that can't be resolved to hostnames. Use D_PARSE instead.

Committed...

steved.

Quoted 19 lines
---
 support/export/hostname.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/export/hostname.c +1 -2
index 94e98a5..5c4c824 100644
@@ -230,7 +230,7 @@ host_canonname(const struct sockaddr *sap)
 	default:
 		(void)getnameinfo(sap, salen, buf, (socklen_t)sizeof(buf),
 							NULL, 0, NI_NUMERICHOST);
-		xlog(D_GENERAL, "%s: failed to resolve %s: %s",
+		xlog(D_PARSE, "%s: failed to resolve %s: %s",
 				__func__, buf, gai_strerror(error));
 		return NULL;
 	}
-- 2.4.11