Blob Blame History Raw
From: Sami Farin <hvtaifwkbgefbaei@gmail.com>
Date: Fri, 14 Mar 2014 00:00:00 -0600
Subject: [PATCH] sysctl: increase max supported line length of the conf file

I ran into this limit with net.ipv4.ip_local_reserved_ports ,
sysctl complained about the line after the long line, further
slowing down my error hunting.

Due to fgets usage, increase buffer size to 4096 chars with
minimum amount of code changes.

Signed-off-by: Sami Farin <hvtaifwkbgefbaei@gmail.com>

--- a/sysctl.c	2013-10-11 02:04:36.000000000 +0300
+++ b/sysctl.c	2014-03-01 12:47:47.629400962 +0200
@@ -483,14 +483,16 @@ static int pattern_match(const char *str
 	return (1);
 }
 
+#define LINELEN 4096
+
 /*
  * Preload the sysctl's from the conf file.  We parse the file and then
  * reform it (strip out whitespace).
  */
 static int Preload(const char *restrict const filename)
 {
-	char oneline[256];
-	char buffer[256];
+	char oneline[LINELEN];
+	char buffer[LINELEN];
 	FILE *fp;
 	char *t;
 	int n = 0;