scsi: fcoe_ctlr: use unpredictable RNG
Subsystems (2)
PATCH 1/1 scsi: fcoe_ctlr: use unpredictable RNG
The prandom_*() functions are only suitable for testsuites that need repeatable/seeded randomness. The rest of FCOE uses the proper get_random_xx() functions, but this one use case was oddly left out. So convert it to use get_random_u16().
Cc Hannes Reinecke <[email protected]>
Cc James E.J. Bottomley <[email protected]>
Cc Martin K. Petersen <[email protected]>
Signed-off-by Jason A. Donenfeld <[email protected]>
--- drivers/scsi/fcoe/fcoe_ctlr.c | 3 +-- include/scsi/libfcoe.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/scsi/fcoe/fcoe_ctlr.c +1 -2
@@ -2224,7 +2224,7 @@ static void fcoe_ctlr_vn_restart(struct fcoe_ctlr *fip)*/ port_id = fip->port_id;if (fip->probe_tries) - port_id =prandom_u32_state (&fip->rnd_state) &0xffff ; + port_id =get_random_u16 ();else if (!port_id) port_id = fip->lp->wwpn &0xffff ;if (!port_id || port_id ==0xffff )
@@ -2249,7 +2249,6 @@ static void fcoe_ctlr_vn_restart(struct fcoe_ctlr *fip)static void fcoe_ctlr_vn_start (struct fcoe_ctlr *fip) { fip->probe_tries =0 ; -prandom_seed_state (&fip->rnd_state, fip->lp->wwpn);fcoe_ctlr_vn_restart (fip); }
include/scsi/libfcoe.h +0 -2
@@ -92,7 +92,6 @@ enum fip_mode {* @recv_work: &work_struct for receiving FIP frames. * @fip_recv_list: list of received FIP frames. * @flogi_req: clone of FLOGI request sent -* @rnd_state: state for pseudo-random number generator. * @port_id: proposed or selected local-port ID. * @user_mfs: configured maximum FC frame size, including FC header. * @flogi_oxid: exchange ID of most recent fabric login.
@@ -133,7 +132,6 @@ struct fcoe_ctlr {struct sk_buff_head fip_recv_list;struct sk_buff *flogi_req; -struct rnd_state rnd_state;u32 port_id;u16 user_mfs;
Signature · 1 line
2.39.0