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/in_pcb.h | |
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/in_pcb.h')
-rw-r--r-- | sys/netinet/in_pcb.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 0bb4bac28a9..0a3bb35a43b 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.h,v 1.140 2023/11/29 18:30:48 bluhm Exp $ */ +/* $OpenBSD: in_pcb.h,v 1.141 2023/12/01 15:30:46 bluhm Exp $ */ /* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */ /* @@ -335,5 +335,10 @@ void in6_pcbnotify(struct inpcbtable *, struct sockaddr_in6 *, int in6_selecthlim(struct inpcb *); int in_pcbpickport(u_int16_t *, const void *, int, const struct inpcb *, struct proc *); +int in_pcbset_rtableid(struct inpcb *, u_int); +void in_pcbset_laddr(struct inpcb *, const struct sockaddr *, u_int); +void in_pcbunset_faddr(struct inpcb *); +void in_pcbunset_laddr(struct inpcb *); + #endif /* _KERNEL */ #endif /* _NETINET_IN_PCB_H_ */ |