Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153300021
D20011.id56494.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
682 B
Referenced Files
None
Subscribers
None
D20011.id56494.diff
View Options
Index: sys/netinet6/ip6_id.c
===================================================================
--- sys/netinet6/ip6_id.c
+++ sys/netinet6/ip6_id.c
@@ -89,6 +89,7 @@
#include <sys/types.h>
#include <sys/param.h>
#include <sys/kernel.h>
+#include <sys/random.h>
#include <sys/socket.h>
#include <sys/libkern.h>
@@ -258,5 +259,15 @@
ip6_randomflowlabel(void)
{
+ /*
+ * It's ok to emit zero flow labels early, before random is available
+ * (seeded). RFC 6437:
+ *
+ * "A Flow Label of zero is used to indicate packets that have not been
+ * labeled."
+ */
+ if (__predict_false(!is_random_seeded()))
+ return (0);
+
return randomid(&randomtab_20) & 0xfffff;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 8:19 AM (6 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31875370
Default Alt Text
D20011.id56494.diff (682 B)
Attached To
Mode
D20011: ip6_randomflowlabel: Avoid blocking if random(4) is not available
Attached
Detach File
Event Timeline
Log In to Comment