summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pr/include/prnetdb.h7
-rw-r--r--pr/src/misc/prnetdb.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/pr/include/prnetdb.h b/pr/include/prnetdb.h
index 7a7ea863..8506d21c 100644
--- a/pr/include/prnetdb.h
+++ b/pr/include/prnetdb.h
@@ -49,8 +49,13 @@ typedef struct PRHostEnt {
/* A safe size to use that will mostly work... */
#if (defined(AIX) && defined(_THREAD_SAFE))
#define PR_NETDB_BUF_SIZE sizeof(struct protoent_data)
+#define PR_MIN_NETDB_BUF_SIZE PR_NETDB_BUF_SIZE
#else
-#define PR_NETDB_BUF_SIZE 1024
+/* PR_NETDB_BUF_SIZE is the recommended buffer size */
+#define PR_NETDB_BUF_SIZE 2048
+/* PR_MIN_NETDB_BUF_SIZE is the smallest buffer size that the API
+ * accepts (for backward compatibility). */
+#define PR_MIN_NETDB_BUF_SIZE 1024
#endif
/***********************************************************************
diff --git a/pr/src/misc/prnetdb.c b/pr/src/misc/prnetdb.c
index 0f645b64..baf49d81 100644
--- a/pr/src/misc/prnetdb.c
+++ b/pr/src/misc/prnetdb.c
@@ -1248,7 +1248,7 @@ PR_IMPLEMENT(PRStatus) PR_GetProtoByName(
}
#endif /* defined(_PR_HAVE_GETPROTO_R_INT) */
- if (PR_NETDB_BUF_SIZE > buflen)
+ if (PR_MIN_NETDB_BUF_SIZE > buflen)
{
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;
@@ -1331,7 +1331,7 @@ PR_IMPLEMENT(PRStatus) PR_GetProtoByNumber(
}
#endif /* defined(_PR_HAVE_GETPROTO_R_INT) */
- if (PR_NETDB_BUF_SIZE > buflen)
+ if (PR_MIN_NETDB_BUF_SIZE > buflen)
{
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;