summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2004-07-16 18:08:13 +0000
committerume <ume@FreeBSD.org>2004-07-16 18:08:13 +0000
commit6418d70e35468f4ffc9328d27c0aa7d2bca68255 (patch)
treef6f508ca86e087d907a6a1429bd26abbbf1d7c59 /sys
parent3a094836b49d08d76bd712b5b411157e96c4878d (diff)
downloadFreeBSD-src-6418d70e35468f4ffc9328d27c0aa7d2bca68255.zip
FreeBSD-src-6418d70e35468f4ffc9328d27c0aa7d2bca68255.tar.gz
when IN6P_AUTOFLOWLABEL is set, the flowlabel is not set on
outgoing tcp connections. Reported by: Orla McGann <orly@cnri.dit.ie> Reviewed by: Orla McGann <orly@cnri.dit.ie> Obtained from: KAME
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_usrreq.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index c223ffc..1942f6b 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -33,6 +33,7 @@
#include "opt_ipsec.h"
#include "opt_inet.h"
#include "opt_inet6.h"
+#include "opt_random_ip_id.h"
#include "opt_tcpdebug.h"
#include <sys/param.h>
@@ -942,8 +943,15 @@ tcp6_connect(tp, nam, td)
inp->in6p_laddr = *addr6;
inp->in6p_faddr = sin6->sin6_addr;
inp->inp_fport = sin6->sin6_port;
- if ((sin6->sin6_flowinfo & IPV6_FLOWINFO_MASK) != 0)
- inp->in6p_flowinfo = sin6->sin6_flowinfo;
+ /* update flowinfo - draft-itojun-ipv6-flowlabel-api-00 */
+ inp->in6p_flowinfo &= ~IPV6_FLOWLABEL_MASK;
+ if (inp->in6p_flags & IN6P_AUTOFLOWLABEL)
+ inp->in6p_flowinfo |=
+#ifdef RANDOM_IP_ID
+ (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK);
+#else
+ (htonl(ip6_flow_seq++) & IPV6_FLOWLABEL_MASK);
+#endif
in_pcbrehash(inp);
/* Compute window scaling to request. */
OpenPOWER on IntegriCloud