mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
Fix SIGABRT in Ping loop
This commit is contained in:
parent
6e811e87b3
commit
80f9af08b3
1 changed files with 2 additions and 2 deletions
|
|
@ -229,7 +229,7 @@ void Ping::pollResults() {
|
|||
if(select(fd_max+1, &mask, 0, 0, &wait_time) > 0) {
|
||||
unsigned char buf[1024];
|
||||
|
||||
if(FD_ISSET(sd, &mask)) {
|
||||
if(sd != -1 && FD_ISSET(sd, &mask)) {
|
||||
struct sockaddr_in addr;
|
||||
socklen_t len = sizeof(addr);
|
||||
|
||||
|
|
@ -237,7 +237,7 @@ void Ping::pollResults() {
|
|||
handleICMPResponse(buf, bytes, &addr.sin_addr, NULL);
|
||||
}
|
||||
|
||||
if(FD_ISSET(sd6, &mask)) {
|
||||
if(sd6 != -1 && FD_ISSET(sd6, &mask)) {
|
||||
struct sockaddr_in6 addr;
|
||||
socklen_t len = sizeof(addr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue