monitor: Call FD_ISSET with valid descriptors only
Phil Sutter
reviewerPATCH 1/1 monitor: Call FD_ISSET with valid descriptors only
This fixes for 'nft monitor' aborting with:
*** bit out of range 0 - FD_SETSIZE on fd_set ***: terminated
It appears FD_ISSET is not tolerating invalid fd values (-1 in this case).
Fixes 868040f892238 ("configure: Implement --enable-profiling option")
Signed-off-by Phil Sutter <[email protected]>
--- src/mnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/mnl.c +1 -1
@@ -2410,7 +2410,7 @@ int mnl_nft_event_listener(struct mnl_socket *nf_sock, unsigned int debug_mask,if (ret <0 )return -1 ; -if (FD_ISSET (sigfd, &readfds)) +if (sigfd !=-1 &&FD_ISSET (sigfd, &readfds))check_signalfd (sigfd);if (FD_ISSET (fd, &readfds)) {
Signature · 1 line
2.51.0