diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-10-01 21:41:06 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-10-01 21:41:06 +0000 |
commit | caf81512042f243e72c8314f283a38aac79e6b23 (patch) | |
tree | 374911f1bf9885f1f3dfafa6d7c427ce959f2a6c /sys/netinet | |
parent | ef8e5a965d1f5d52e229c52742fc6374a12db46d (diff) |
use random number generator to generate IPv6 fragment ID/flowlabel.
cleanup IPv6 flowlabel handling. deraadt ok
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_input.c | 8 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 5b8b3270f41..5ceeb6ccc9b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.132 2003/07/09 22:03:16 itojun Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.133 2003/10/01 21:41:05 itojun Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -829,8 +829,6 @@ findpcb: if ((inp->inp_flags & INP_IPV6) != 0) { inp->inp_ipv6.ip6_hlim = oldinpcb->inp_ipv6.ip6_hlim; - inp->inp_ipv6.ip6_flow = - oldinpcb->inp_ipv6.ip6_flow; } } #else /* INET6 */ @@ -1189,8 +1187,8 @@ findpcb: sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_addr = ip6->ip6_src; sin6->sin6_port = th->th_sport; - sin6->sin6_flowinfo = htonl(0x0fffffff) & - inp->inp_ipv6.ip6_flow; + sin6->sin6_flowinfo = + ip6->ip6_flow & IPV6_FLOWINFO_MASK; laddr6 = inp->inp_laddr6; if (IN6_IS_ADDR_UNSPECIFIED(&inp->inp_laddr6)) inp->inp_laddr6 = ip6->ip6_dst; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 2706c5edb18..e5ecf5c0ee2 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.68 2003/07/09 22:03:16 itojun Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.69 2003/10/01 21:41:05 itojun Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -274,7 +274,7 @@ tcp_template(tp) ip6->ip6_src = inp->inp_laddr6; ip6->ip6_dst = inp->inp_faddr6; ip6->ip6_flow = htonl(0x60000000) | - (inp->inp_ipv6.ip6_flow & htonl(0x0fffffff)); + (inp->inp_flowinfo & IPV6_FLOWLABEL_MASK); ip6->ip6_nxt = IPPROTO_TCP; ip6->ip6_plen = htons(sizeof(struct tcphdr)); /*XXX*/ |