From 174624e01d01ee25fd6b1dfbc7791fd5c8ef9852 Mon Sep 17 00:00:00 2001 From: Mike Silbersack Date: Thu, 22 Apr 2004 08:34:55 +0000 Subject: [PATCH] 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. --- sys/netinet/in_pcb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index a02ada77c47..516aa4681da 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);