summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_id.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2003-10-01 21:24:28 +0000
committerume <ume@FreeBSD.org>2003-10-01 21:24:28 +0000
commitdff1ad31d578de8652ddb2af57b20afeef17161b (patch)
tree40cbf0f17e6e447a893c3c70e1a6ee492c6a779e /sys/netinet6/ip6_id.c
parent1510816eb2189f841fa0c9d83a1491b4e9228642 (diff)
downloadFreeBSD-src-dff1ad31d578de8652ddb2af57b20afeef17161b.zip
FreeBSD-src-dff1ad31d578de8652ddb2af57b20afeef17161b.tar.gz
randomize IPv6 flowlabel when RANDOM_IP_ID is defined.
Obtained from: KAME
Diffstat (limited to 'sys/netinet6/ip6_id.c')
-rw-r--r--sys/netinet6/ip6_id.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netinet6/ip6_id.c b/sys/netinet6/ip6_id.c
index 8ed0b8d..cd2ae2d 100644
--- a/sys/netinet6/ip6_id.c
+++ b/sys/netinet6/ip6_id.c
@@ -250,4 +250,11 @@ ip6_randomid(void)
return randomid(&randomtab_32);
}
+u_int32_t
+ip6_randomflowlabel(void)
+{
+
+ return randomid(&randomtab_20) & 0xfffff;
+}
+
#endif /* RANDOM_IP_ID */
OpenPOWER on IntegriCloud