Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160260627
D20011.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
708 B
Referenced Files
None
Subscribers
None
D20011.diff
View Options
Index: head/sys/netinet6/ip6_id.c
===================================================================
--- head/sys/netinet6/ip6_id.c
+++ head/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>
@@ -257,6 +258,16 @@
u_int32_t
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, Jun 23, 4:12 PM (15 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34253330
Default Alt Text
D20011.diff (708 B)
Attached To
Mode
D20011: ip6_randomflowlabel: Avoid blocking if random(4) is not available
Attached
Detach File
Event Timeline
Log In to Comment