Date: Thu, 1 Jan 2009 19:31:02 +0100 From: Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= <patfbsd@davenulle.org> To: freebsd-hackers@freebsd.org Subject: hifn(4) few small changes Message-ID: <20090101193102.2ebbbd53@baby-jane-lamaiziere-net.local>
next in thread | raw e-mail | index | archive | help
Hello and happy new year, I would like to suggest few changes in the hifn driver: diff between CURRENT: http://user.lamaiziere.net/patrick/hifn-010109/hifn-patch.txt hifn_attach() - Useless bzero of softc hifn_detach() - Return EBUSY if there is active session - Free the sessions - Use callout_drain() instead callout_stop() hifn_rng() - Remove the unused macro RANDOM_BITS hifn_newsession() - Add and use a rwlock to lock the sessions (sc->sc_sessions_lock). - Remove useless bzero of the sessions (use malloc with M_ZERO) - Use arc4rand() instead read_random() hifn_freesession() - Use a rwlock to lock the sessions hifn_process() - Use a rwlock to lock the sessions. In the current driver there is no lock to protect the sessions in hifn_process() but the sessions can be reallocated in hifn_newsession(). I think this is the cause of PR kern/91407 http://www.FreeBSD.org/cgi/query-pr.cgi?pr=kern/91407 hifn_callback() - Use a rwlock to lock the sessions. I've tested on a Soekris vpn 1411 (hifn 7955) with ipsec and openssl. Regards. (With big thanks to Mike Tancsa)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090101193102.2ebbbd53>