On Mon, 5 Jul 2004, Matt Sergeant wrote:

> http://linux.voyager.hr/ucspi-tcp/tcpserver-limits-2004-03-27.diff

Thanks Matt, I was unaware of that patch. Here's my own patch to it, to
get the MAXLOAD working under FreeBSD:

*** tcpserver.c.orig    Mon Jul  5 14:47:28 2004
--- tcpserver.c Mon Jul  5 16:12:13 2004
***************
*** 230,235 ****
--- 230,236 ----
      }
    }

+ #ifndef __FreeBSD__
    if (maxload) {
        int lret;
        int i;
***************
*** 252,257 ****
--- 253,268 ----
                }
        }
    }
+ #else
+   if (maxload) {
+       double result;
+
+       if (getloadavg(&result, 1) == 1) {
+               curload = result * 100;
+               if (curload > maxload) flagdeny = 2;
+       }
+   }
+ #endif

    if (!flagdeny && (maxconnip || maxconnc)) {
        unsigned long u, c1=0, cc=0;

  Cheers.

-- 
Mark Powell - UNIX System Administrator - The University of Salford
Information Services Division, Clifford Whitworth Building,
Salford University, Manchester, M5 4WT, UK.
Tel: +44 161 295 4837  Fax: +44 161 295 5888  www.pgp.com for PGP key

Reply via email to