summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ssh/packet.c')
-rw-r--r--usr.bin/ssh/packet.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index bc9f08b301f..6f0f3f0022d 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -15,7 +15,7 @@ with the other side. This same code is used both on client and server side.
*/
#include "includes.h"
-RCSID("$Id: packet.c,v 1.11 1999/11/15 21:38:54 markus Exp $");
+RCSID("$Id: packet.c,v 1.12 1999/11/19 19:58:18 markus Exp $");
#include "xmalloc.h"
#include "buffer.h"
@@ -66,6 +66,9 @@ static Buffer compression_buffer;
/* Flag indicating whether packet compression/decompression is enabled. */
static int packet_compression = 0;
+/* default maximum packet size */
+int max_packet_size = 32768;
+
/* Flag indicating whether this module has been initialized. */
static int initialized = 0;
@@ -745,3 +748,20 @@ packet_is_interactive()
{
return interactive_mode;
}
+
+int
+packet_set_maxsize(int s)
+{
+ static int called = 0;
+ if (called) {
+ log("packet_set_maxsize: called twice: old %d new %d", max_packet_size, s);
+ return -1;
+ }
+ if (s < 4*1024 || s > 1024*1024) {
+ log("packet_set_maxsize: bad size %d", s);
+ return -1;
+ }
+ log("packet_set_maxsize: setting to %d", s);
+ max_packet_size = s;
+ return s;
+}