diff options
-rw-r--r-- | lib/socket_wrapper/socket_wrapper.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c index d1508adbca..26988f0b1f 100644 --- a/lib/socket_wrapper/socket_wrapper.c +++ b/lib/socket_wrapper/socket_wrapper.c @@ -2244,6 +2244,11 @@ int swrap_readv(int s, const struct iovec *vector, size_t count) return real_readv(s, vector, count); } + if (!si->connected) { + errno = ENOTCONN; + return -1; + } + if (si->type == SOCK_STREAM && count > 0) { /* cut down to 1500 byte packets for stream sockets, * which makes it easier to format PCAP capture files |