diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-12-01 15:30:48 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-12-01 15:30:48 +0000 |
commit | 79bfbb1f7b40023e6734a64726ea32264ed253b2 (patch) | |
tree | bd759f478b3f45ecf7231951fc2b1a319f07cdb7 /sys/netinet/tcp_usrreq.c | |
parent | b1fcc3145ae8770e9fdfc598b1aa70fd247f4b36 (diff) |
Set inp address, port and rtable together with inpcb hash.
The inpcb hash table is protected by table->inpt_mtx. The hash is
based on addresses, ports, and routing table. These fields were
not sychronized with the hash. Put writes and hash update into the
same critical section.
Move the updates from ip_ctloutput(), ip6_ctloutput(), syn_cache_get(),
tcp_connect(), udp_disconnect() to dedicated inpcb set functions.
There they use the same table mutex as in_pcbrehash().
in_pcbbind(), in_pcbconnect(), and in6_pcbconnect() need more work
and are not included yet.
OK sashan@ mvs@
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index e7f9767e0ae..5f06150ff6a 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.225 2023/12/01 14:08:03 bluhm Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.226 2023/12/01 15:30:47 bluhm Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -656,6 +656,7 @@ tcp_connect(struct socket *so, struct mbuf *nam) tp->t_template = tcp_template(tp); if (tp->t_template == 0) { + in_pcbunset_faddr(inp); in_pcbdisconnect(inp); error = ENOBUFS; goto out; |