summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2014-11-06 07:41:32 +0000
committerdlg <dlg@openbsd.org>2014-11-06 07:41:32 +0000
commitde02581103b83f186ef8e67eff5b46f1dba355ee (patch)
treeb12f7b069e2edde1ebe5a17626382d0f8f1a48ca /sys/netinet/tcp_subr.c
parentCleanup whitespace and add 5 series comments. (diff)
downloadwireguard-openbsd-de02581103b83f186ef8e67eff5b46f1dba355ee.tar.xz
wireguard-openbsd-de02581103b83f186ef8e67eff5b46f1dba355ee.zip
mix the rtable into the hash for tcp sequence number generation.
ok tedu@ claudio@
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index d46914a5e00..2a073571c39 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.134 2014/11/04 15:24:40 mpi Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.135 2014/11/06 07:41:32 dlg Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -954,7 +954,7 @@ tcp_set_iss_tsm(struct tcpcb *tp)
uint8_t bytes[SHA512_DIGEST_LENGTH];
uint32_t words[2];
} digest;
-
+ u_int rtable = rtable_l2(tp->t_inpcb->inp_rtableid);
if (tcp_secret_init == 0) {
arc4random_buf(tcp_secret, sizeof(tcp_secret));
@@ -963,6 +963,7 @@ tcp_set_iss_tsm(struct tcpcb *tp)
tcp_secret_init = 1;
}
ctx = tcp_secret_ctx;
+ SHA512Update(&ctx, (char *)&rtable, sizeof(rtable));
SHA512Update(&ctx, (char *)&tp->t_inpcb->inp_lport, sizeof(u_short));
SHA512Update(&ctx, (char *)&tp->t_inpcb->inp_fport, sizeof(u_short));
if (tp->pf == AF_INET6) {