]> The Tcpdump Group git mirrors - libpcap/commitdiff
rpcapd: Simplify a condition
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 18 Jun 2020 11:33:04 +0000 (13:33 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 18 Jun 2020 11:33:59 +0000 (13:33 +0200)
rpcapd/daemon.c:750:47: style: The condition 'session==NULL ||
session!=NULL && session->sockdata==0' is equivalent to
'session==NULL || session->sockdata==0'. [redundantCondition]
  if ((!pars.isactive) &&  ((session == NULL) || ((session != NULL) &&
      (session->sockdata == 0))))
                                              ^

rpcapd/daemon.c

index a0ca1a86fc5fea196257ca148b5e33a960558d33..67c61e558af270acbb56dff459d791c551f7b97d 100644 (file)
@@ -747,7 +747,7 @@ daemon_serviceloop(SOCKET sockctrl, int isactive, char *passiveClients,
                //
                // Be carefully: the capture can have been started, but an error occurred (so session != NULL, but
                //  sockdata is 0
-               if ((!pars.isactive) &&  ((session == NULL) || ((session != NULL) && (session->sockdata == 0))))
+               if ((!pars.isactive) && (session == NULL || session->sockdata == 0))
                {
                        // Check for the initial timeout
                        FD_ZERO(&rfds);