diff -r 784c45b27326 src/internet-stack/tcp-socket-impl.cc --- a/src/internet-stack/tcp-socket-impl.cc Thu Nov 06 11:52:59 2008 -0800 +++ b/src/internet-stack/tcp-socket-impl.cc Thu Nov 06 15:46:32 2008 -0500 @@ -456,6 +456,12 @@ TcpSocketImpl::Listen (void) { NS_LOG_FUNCTION (this); + //linux quits EINVAL if we're not closed, so match what they do + if (m_state != CLOSED) + { + m_errno = ERROR_INVAL; + return -1; + } Actions_t action = ProcessEvent (APP_LISTEN); ProcessAction (action); return 0;