Date: Tue, 11 May 1999 15:42:50 +0530 (IST) From: Ajit Shimpi <ajit@wipinfo.soft.net> To: freebsd-net@FreeBSD.ORG Subject: socket close() Message-ID: <Pine.LNX.4.05.9905111541190.21167-100000@voyager.wipinfo.soft.net>
next in thread | raw e-mail | index | archive | help
Hi,
I am going through socket layer implementation of close() system call
(4.4BSD Lite-2 sources). In the function soclose()
(file : kern/uipc_socket.c), sofree() is called. In sofree(), one
of the first checks made is whether so->so_pcb field of socket structure
(so) is NULL. This, I feel, is non-null, since soclose() calls
PRU_DISCONNECT and then PRU_DETACH user requests. The tcp_usrreq()
function handles these requests by calling tcp_disconnect() for
connection in ESTABLISHED state.
If the "so_pcb" field is non-null, sofree() returns without freeing
socket structure (so).
Can anyone explain if the PCB associated with the socket is freed for
ESABLISHED connections? Or is it a defect?
[ Btw, tcp_close() does all the freeing job; but is never called for TCP
connections in ESTABLISHED state.]
Thanks in advance,
Ajit.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.05.9905111541190.21167-100000>
