diff -r 0dc8bd74c6e4 src/node/packet-socket.cc --- a/src/node/packet-socket.cc Tue Feb 23 13:01:26 2010 +0100 +++ b/src/node/packet-socket.cc Wed Mar 03 11:53:32 2010 +1100 @@ -185,6 +185,12 @@ m_errno = ERROR_BADF; return -1; } + else if (m_state == STATE_BOUND || + m_state == STATE_CONNECTED) + { + m_node->UnregisterProtocolHandler (MakeCallback (&PacketSocket::ForwardUp, this)); + } + m_state = STATE_CLOSED; m_shutdownSend = true; m_shutdownRecv = true;