# HG changeset patch # User Garrett D'Amore # Date 1287552904 25200 # Node ID fed843d791e93178d0b00303d26062033860b228 # Parent 233eeb988b49efb33151bd65d9a24f12fab71939 349 hang during network boot (circular kcf dependency) Reviewed by: richlowe@richlowe.net Reviewed by: gwr@nexenta.com Reviewed by: bryancantrill@nexenta.com Approved by: gwr@nexenta.com diff -r 233eeb988b49 -r fed843d791e9 usr/src/uts/common/crypto/api/kcf_random.c --- a/usr/src/uts/common/crypto/api/kcf_random.c Fri Oct 15 02:19:06 2010 -0400 +++ b/usr/src/uts/common/crypto/api/kcf_random.c Tue Oct 19 22:35:04 2010 -0700 @@ -834,13 +834,22 @@ } } +static void +rnd_mechid(void *notused) +{ + _NOTE(ARGUNUSED(notused)); + rngmech_type = crypto_mech2id(SUN_RANDOM); +} + void kcf_rnd_schedule_timeout(boolean_t do_mech2id) { clock_t ut; /* time in microseconds */ - if (do_mech2id) - rngmech_type = crypto_mech2id(SUN_RANDOM); + if (do_mech2id) { + /* This should never fail due to TQ_SLEEP. */ + (void) taskq_dispatch(system_taskq, rnd_mechid, NULL, TQ_SLEEP); + } /* * The new timeout value is taken from the buffer of random bytes.