]> The Tcpdump Group git mirrors - libpcap/commitdiff
If rpcap_discard() fails, don't try another rpcap_discard().
authorGuy Harris <[email protected]>
Sun, 8 Jul 2018 01:18:02 +0000 (18:18 -0700)
committerGuy Harris <[email protected]>
Sun, 8 Jul 2018 01:18:02 +0000 (18:18 -0700)
pcap-rpcap.c

index 65e235f06291b57241e6bc07155984178fc7dbe4..e9d6245bf3992ede4d948bca90330a1de2d91b0f 100644 (file)
@@ -908,7 +908,7 @@ static struct pcap_stat *rpcap_stats_rpcap(pcap_t *p, struct pcap_stat *ps, int
 
        /* Discard the rest of the message. */
        if (rpcap_discard(pr->rmt_sockctrl, plen, p->errbuf) == -1)
-               goto error;
+               goto error_nodiscard;
 
        return ps;
 
@@ -920,6 +920,7 @@ error:
         */
        (void)rpcap_discard(pr->rmt_sockctrl, plen, NULL);
 
+error_nodiscard:
        return NULL;
 }
 
@@ -1334,7 +1335,7 @@ static int pcap_startcapture_remote(pcap_t *fp)
 
        /* Discard the rest of the message. */
        if (rpcap_discard(pr->rmt_sockctrl, plen, fp->errbuf) == -1)
-               goto error;
+               goto error_nodiscard;
 
        /*
         * In case the user does not want to capture RPCAP packets, let's update the filter
@@ -2648,7 +2649,7 @@ pcap_findalldevs_ex_remote(char *source, struct pcap_rmtauth *auth, pcap_if_t **
 
        /* Discard the rest of the message. */
        if (rpcap_discard(sockctrl, plen, errbuf) == 1)
-               return -1;
+               goto error_nodiscard;
 
        /* Control connection has to be closed only in case the remote machine is in passive mode */
        if (!active)