summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2019-08-12 20:27:33 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2019-08-12 20:27:33 +0000
commit6b462d2762d67c5d839020d6cc77052bbf2a18cd (patch)
treec34db7db1d9f957ee3ad8efecf57b06a29f10f68 /include
parent26b6a67b98153462d8a708461c9479e7a9b3a16d (diff)
downloadsrc-test2-6b462d2762d67c5d839020d6cc77052bbf2a18cd.tar.gz
src-test2-6b462d2762d67c5d839020d6cc77052bbf2a18cd.zip
Increase YPMAXRECORD to 16M to be compatible with Linux.
Since YP protocol definition uses the constant to declare variable-size opaque byte strings, the change should be binary compatible with existing installations which do not expose keys or values larger than 1024 bytes. All uses of local variables with YPMAXRECORD sizes were removed to avoid insane stack use. On the other hand, variables with static lifetime should be fine and only result in increased VA use. Glibc made same change, increasing the allowed length for keys and values in YP to 16M, in 2013. Reviewed by: markj Discussed with: ian Sponsored by: Mellanox Technologies MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D20900
Notes
Notes: svn path=/head/; revision=350957
Diffstat (limited to 'include')
-rw-r--r--include/rpcsvc/yp.x2
-rw-r--r--include/rpcsvc/yp_prot.h2
-rw-r--r--include/rpcsvc/ypxfrd.x2
3 files changed, 3 insertions, 3 deletions
diff --git a/include/rpcsvc/yp.x b/include/rpcsvc/yp.x
index 62daee10f35e..91614b20486f 100644
--- a/include/rpcsvc/yp.x
+++ b/include/rpcsvc/yp.x
@@ -40,7 +40,7 @@
%__FBSDID("$FreeBSD$");
#endif
-const YPMAXRECORD = 1024;
+const YPMAXRECORD = 16777216;
const YPMAXDOMAIN = 64;
const YPMAXMAP = 64;
const YPMAXPEER = 64;
diff --git a/include/rpcsvc/yp_prot.h b/include/rpcsvc/yp_prot.h
index dd73adfb276e..889e7cceea8c 100644
--- a/include/rpcsvc/yp_prot.h
+++ b/include/rpcsvc/yp_prot.h
@@ -79,7 +79,7 @@ typedef u_int bool;
#define YPPROG ((u_long)100004)
#define YPVERS ((u_long)2)
#define YPVERS_ORIG ((u_long)1)
-#define YPMAXRECORD ((u_long)1024)
+#define YPMAXRECORD ((u_long)16 * 1024 * 1024)
#define YPMAXDOMAIN ((u_long)64)
#define YPMAXMAP ((u_long)64)
#define YPMAXPEER ((u_long)256)
diff --git a/include/rpcsvc/ypxfrd.x b/include/rpcsvc/ypxfrd.x
index 7efab3dd63b0..e6ff902a1dfe 100644
--- a/include/rpcsvc/ypxfrd.x
+++ b/include/rpcsvc/ypxfrd.x
@@ -70,7 +70,7 @@
#endif
/* XXX cribbed from yp.x */
-const _YPMAXRECORD = 1024;
+const _YPMAXRECORD = 16777216;
const _YPMAXDOMAIN = 64;
const _YPMAXMAP = 64;
const _YPMAXPEER = 64;