diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-06-02 08:18:27 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-06-02 08:18:27 +0000 |
commit | 88f1a971b9f1f90fb7321d5a06705df8eb0040db (patch) | |
tree | 585da5b6bcb40ea92a1a054ba3d2e15ed19b08b0 /sys/netinet/in_pcb.c | |
parent | 781f6a594a85f49acaa709b85cef33f32513b780 (diff) | |
download | FreeBSD-src-88f1a971b9f1f90fb7321d5a06705df8eb0040db.zip FreeBSD-src-88f1a971b9f1f90fb7321d5a06705df8eb0040db.tar.gz |
Minor restyling and cleanup around ipport_tick().
MFC after: 1 month
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index eecc196..83b9407 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); } |