aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2006-06-02 08:18:27 +0000
committerRobert Watson <rwatson@FreeBSD.org>2006-06-02 08:18:27 +0000
commitad3a630f7e5d16965f2c8eaa450d7dde278fa479 (patch)
tree585da5b6bcb40ea92a1a054ba3d2e15ed19b08b0
parent4ec449ae88522718e3395b0dd0eb66a5e256e789 (diff)
Notes
-rw-r--r--sys/netinet/in_pcb.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index eecc1966b2dd..83b9407aec28 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1224,23 +1224,21 @@ in_pcbsosetlabel(struct socket *so)
}
/*
- * ipport_tick runs once per second, determining if random port
- * allocation should be continued. If more than ipport_randomcps
- * ports have been allocated in the last second, then we return to
- * sequential port allocation. We return to random allocation only
- * once we drop below ipport_randomcps for at least ipport_randomtime
- * seconds.
+ * ipport_tick runs once per second, determining if random port allocation
+ * should be continued. If more than ipport_randomcps ports have been
+ * allocated in the last second, then we return to sequential port
+ * allocation. We return to random allocation only once we drop below
+ * ipport_randomcps for at least ipport_randomtime seconds.
*/
-
void
ipport_tick(void *xtp)
{
- if (ipport_tcpallocs > ipport_tcplastcount + ipport_randomcps) {
- ipport_stoprandom = ipport_randomtime;
- } else {
+
+ if (ipport_tcpallocs <= ipport_tcplastcount + ipport_randomcps) {
if (ipport_stoprandom > 0)
ipport_stoprandom--;
- }
+ } else
+ ipport_stoprandom = ipport_randomtime;
ipport_tcplastcount = ipport_tcpallocs;
callout_reset(&ipport_tick_callout, hz, ipport_tick, NULL);
}