summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2004-04-22 08:34:55 +0000
committersilby <silby@FreeBSD.org>2004-04-22 08:34:55 +0000
commitb4c0a798a225a624e180b323c4dd94c9e623eec4 (patch)
tree26dccc6b9d44c74128871c6f2185eaa4423d7f65 /sys/netinet/in_pcb.c
parent760a7deec6e5e4cd0ae94c817e97d03407ec7087 (diff)
downloadFreeBSD-src-b4c0a798a225a624e180b323c4dd94c9e623eec4.zip
FreeBSD-src-b4c0a798a225a624e180b323c4dd94c9e623eec4.tar.gz
Take out an unneeded variable I forgot to remove in the last commit,
and make two small whitespace fixes so that diffs vs rev 1.142 are minimal.
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index a02ada7..516aa46 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -383,7 +383,7 @@ in_pcbbind_setup(inp, nam, laddrp, lportp, cred)
lport = *lportp;
if (lport == 0) {
u_short first, last;
- int count, loopcount;
+ int count;
if (laddr.s_addr != INADDR_ANY)
if (prison_ip(cred, 0, &laddr.s_addr))
@@ -411,7 +411,6 @@ in_pcbbind_setup(inp, nam, laddrp, lportp, cred)
* We split the two cases (up and down) so that the direction
* is not being tested on each round of the loop.
*/
- loopcount = 0;
if (first > last) {
/*
* counting down
@@ -419,6 +418,7 @@ in_pcbbind_setup(inp, nam, laddrp, lportp, cred)
if (ipport_randomized)
*lastport = first - (arc4random() % (first - last));
count = first - last;
+
do {
if (count-- < 0) /* completely used? */
return (EADDRNOTAVAIL);
@@ -435,6 +435,7 @@ in_pcbbind_setup(inp, nam, laddrp, lportp, cred)
if (ipport_randomized)
*lastport = first + (arc4random() % (last - first));
count = last - first;
+
do {
if (count-- < 0) /* completely used? */
return (EADDRNOTAVAIL);
OpenPOWER on IntegriCloud