recv_thread: Invalidate socket after closing
Closed sockets should be invalidated to prevent
inadvertent use.
@@ -1459,6 +1459,7 @@ recv_thread_destroy(void)
#if defined(INET) || defined(INET6)
if (SCTP_BASE_VAR(userspace_route) != -1) {
close(SCTP_BASE_VAR(userspace_route));
+ SCTP_BASE_VAR(userspace_route) = -1;
}
#endif
#endif
@@ -1469,6 +1470,7 @@ recv_thread_destroy(void)
#else
close(SCTP_BASE_VAR(userspace_rawsctp));
#endif
+ SCTP_BASE_VAR(userspace_rawsctp) = -1;
}
if (SCTP_BASE_VAR(userspace_udpsctp) != -1) {
#if defined(__Userspace_os_Windows)
@@ -1476,6 +1478,7 @@ recv_thread_destroy(void)
#else
close(SCTP_BASE_VAR(userspace_udpsctp));
#endif
+ SCTP_BASE_VAR(userspace_udpsctp) = -1;
}
#endif
#if defined(INET6)
@@ -1485,6 +1488,7 @@ recv_thread_destroy(void)
#else
close(SCTP_BASE_VAR(userspace_rawsctp6));
#endif
+ SCTP_BASE_VAR(userspace_rawsctp6) = -1;
}
if (SCTP_BASE_VAR(userspace_udpsctp6) != -1) {
#if defined(__Userspace_os_Windows)
@@ -1492,6 +1496,7 @@ recv_thread_destroy(void)
#else
close(SCTP_BASE_VAR(userspace_udpsctp6));
#endif
+ SCTP_BASE_VAR(userspace_udpsctp6) = -1;
}
#endif
}
