summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_id.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-08-16 18:32:07 +0000
committerrwatson <rwatson@FreeBSD.org>2004-08-16 18:32:07 +0000
commit87aa99bbbbf620c4ce98996d472fdae45f077eae (patch)
tree6046e1d576e7bbc883254e0b133fbd6b383544f2 /sys/netinet/ip_id.c
parentcc3f0b4929d2de551332227291984a04e5758213 (diff)
downloadFreeBSD-src-87aa99bbbbf620c4ce98996d472fdae45f077eae.zip
FreeBSD-src-87aa99bbbbf620c4ce98996d472fdae45f077eae.tar.gz
White space cleanup for netinet before branch:
- Trailing tab/space cleanup - Remove spurious spaces between or before tabs This change avoids touching files that Andre likely has in his working set for PFIL hooks changes for IPFW/DUMMYNET. Approved by: re (scottl) Submitted by: Xin LI <delphij@frontfree.net>
Diffstat (limited to 'sys/netinet/ip_id.c')
-rw-r--r--sys/netinet/ip_id.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c
index c8455f8..eebc069 100644
--- a/sys/netinet/ip_id.c
+++ b/sys/netinet/ip_id.c
@@ -37,7 +37,7 @@
* $FreeBSD$
*/
-/*
+/*
* seed = random 15bit
* n = prime, g0 = generator to n,
* j = random so that gcd(j,n-1) == 1
@@ -45,7 +45,7 @@
*
* X[0] = random seed.
* X[n] = a*X[n-1]+b mod m is a Linear Congruential Generator
- * with a = 7^(even random) mod m,
+ * with a = 7^(even random) mod m,
* b = random with gcd(b,m) == 1
* m = 31104 and a maximal period of m-1.
*
@@ -72,7 +72,7 @@
#define PFAC_N 3
const static u_int16_t pfacts[PFAC_N] = {
- 2,
+ 2,
3,
2729
};
@@ -119,15 +119,15 @@ pmod(gen, exp, mod)
return (s);
}
-/*
- * Initalizes the seed and chooses a suitable generator. Also toggles
+/*
+ * Initalizes the seed and chooses a suitable generator. Also toggles
* the msb flag. The msb flag is used to generate two distinct
* cycles of random numbers and thus avoiding reuse of ids.
*
- * This function is called from id_randomid() when needed, an
+ * This function is called from id_randomid() when needed, an
* application does not have to worry about it.
*/
-static void
+static void
ip_initid(void)
{
u_int16_t j, i;
@@ -150,12 +150,12 @@ ip_initid(void)
ru_a = pmod(RU_AGEN, (tmp >> 16) & 0xfffe, RU_M);
while (ru_b % 3 == 0)
ru_b += 2;
-
+
read_random((void *) &tmp, sizeof(tmp));
j = tmp % RU_N;
tmp = tmp >> 16;
- /*
+ /*
* Do a fast gcd(j,RU_N-1), so we can find a j with
* gcd(j, RU_N-1) == 1, giving a new generator for
* RU_GEN^j mod RU_N
@@ -168,7 +168,7 @@ ip_initid(void)
if (i>=PFAC_N)
noprime = 0;
- else
+ else
j = (j+1) % RU_N;
}
@@ -176,7 +176,7 @@ ip_initid(void)
ru_counter = 0;
ru_reseed = time.tv_sec + RU_OUT;
- ru_msb = ru_msb == 0x8000 ? 0 : 0x8000;
+ ru_msb = ru_msb == 0x8000 ? 0 : 0x8000;
}
u_int16_t
OpenPOWER on IntegriCloud