From 92d8381dd544a8237b3fd68c4e7fce9bd0903fb2 Mon Sep 17 00:00:00 2001 From: tanimura Date: Mon, 20 May 2002 05:41:09 +0000 Subject: Lock down a socket, milestone 1. o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred --- sys/nfsclient/bootp_subr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/nfsclient/bootp_subr.c') diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c index 124b09f..5e8e6bd9 100644 --- a/sys/nfsclient/bootp_subr.c +++ b/sys/nfsclient/bootp_subr.c @@ -751,8 +751,13 @@ bootpc_call(struct bootpc_globalcontext *gctx, struct thread *td) error = sosend(so, (struct sockaddr *) &dst, &auio, NULL, NULL, 0, td); if (error != 0) { + int sostate; + + SOCK_LOCK(so); + sostate = (int)so->so_state; + SOCK_UNLOCK(so); printf("bootpc_call: sosend: %d state %08x\n", - error, (int) so->so_state); + error, sostate); } /* XXX: Is this needed ? */ -- cgit v1.1