Page MenuHomeFreeBSD

D19972.diff
No OneTemporary

D19972.diff

Index: sys/netinet/in_pcb.c
===================================================================
--- sys/netinet/in_pcb.c
+++ sys/netinet/in_pcb.c
@@ -57,6 +57,7 @@
#include <sys/eventhandler.h>
#include <sys/domain.h>
#include <sys/protosw.h>
+#include <sys/random.h>
#include <sys/rmlock.h>
#include <sys/smp.h>
#include <sys/socket.h>
@@ -637,11 +638,13 @@
* For UDP(-Lite), use random port allocation as long as the user
* allows it. For TCP (and as of yet unknown) connections,
* use random port allocation only if the user allows it AND
- * ipport_tick() allows it.
+ * ipport_tick() allows it. Finally, if the random device is not yet
+ * available, don't try to draw a random number.
*/
if (V_ipport_randomized &&
(!V_ipport_stoprandom || pcbinfo == &V_udbinfo ||
- pcbinfo == &V_ulitecbinfo))
+ pcbinfo == &V_ulitecbinfo) &&
+ is_random_seeded())
dorandom = 1;
else
dorandom = 0;

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 15, 12:01 AM (9 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14635485
Default Alt Text
D19972.diff (927 B)

Event Timeline