X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/f427ee49d309d8fc33ebf3042c3a775f2f530ded..HEAD:/bsd/netinet6/ip6_id.c diff --git a/bsd/netinet6/ip6_id.c b/bsd/netinet6/ip6_id.c index ff6b49af3..24780a446 100644 --- a/bsd/netinet6/ip6_id.c +++ b/bsd/netinet6/ip6_id.c @@ -168,26 +168,6 @@ static struct randomtab randomtab_32 = { .ru_reseed = 0 }; -static struct randomtab randomtab_20 = { - .ru_bits = 20, /* resulting bits */ - .ru_out = 180, /* Time after wich will be reseeded */ - .ru_max = 200000, /* Uniq cycle, avoid blackjack prediction */ - .ru_gen = 2, /* Starting generator */ - .ru_n = 524269, /* RU_N-1 = 2^2*3^2*14563 */ - .ru_agen = 7, /* determine ru_a as RU_AGEN^(2*rand) */ - .ru_m = 279936, /* RU_M = 2^7*3^7 - don't change */ - .pfacts = { 2, 3, 14563, 0 }, /* factors of ru_n */ - .ru_counter = 0, - .ru_msb = 0, - .ru_x = 0, - .ru_seed = 0, - .ru_seed2 = 0, - .ru_a = 0, - .ru_b = 0, - .ru_g = 0, - .ru_reseed = 0 -}; - static u_int32_t pmod(u_int32_t, u_int32_t, u_int32_t); static void initid(struct randomtab *); static u_int32_t randomid(struct randomtab *); @@ -311,5 +291,5 @@ ip6_randomid(void) u_int32_t ip6_randomflowlabel(void) { - return randomid(&randomtab_20) & 0xfffff; + return RandomULong() & IPV6_FLOWLABEL_MASK; }