diff options
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 72c9229979d..1e7e20b8c1a 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip.c,v 1.152 2023/11/26 22:08:10 bluhm Exp $ */ +/* $OpenBSD: raw_ip.c,v 1.153 2023/12/15 00:24:56 bluhm Exp $ */ /* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */ /* @@ -545,7 +545,9 @@ rip_bind(struct socket *so, struct mbuf *nam, struct proc *p) ifa_ifwithaddr(sintosa(addr), inp->inp_rtableid))) return (EADDRNOTAVAIL); + mtx_enter(&rawcbtable.inpt_mtx); inp->inp_laddr = addr->sin_addr; + mtx_leave(&rawcbtable.inpt_mtx); return (0); } @@ -562,7 +564,9 @@ rip_connect(struct socket *so, struct mbuf *nam) if ((error = in_nam2sin(nam, &addr))) return (error); + mtx_enter(&rawcbtable.inpt_mtx); inp->inp_faddr = addr->sin_addr; + mtx_leave(&rawcbtable.inpt_mtx); soisconnected(so); return (0); @@ -579,7 +583,9 @@ rip_disconnect(struct socket *so) return (ENOTCONN); soisdisconnected(so); + mtx_enter(&rawcbtable.inpt_mtx); inp->inp_faddr.s_addr = INADDR_ANY; + mtx_leave(&rawcbtable.inpt_mtx); return (0); } |