From: Guy Harris Date: Mon, 4 Feb 2019 09:55:43 +0000 (-0800) Subject: Send errors for select() failure or timeout with a version of 0. X-Git-Tag: libpcap-1.10-bp~592 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/06a4b58164bac277bad9d4ff33168a1f62131e3a Send errors for select() failure or timeout with a version of 0. If we haven't received a request containing a version number, send the error reply with a version of 0. --- diff --git a/rpcapd/daemon.c b/rpcapd/daemon.c index d513a458..b7059b83 100644 --- a/rpcapd/daemon.c +++ b/rpcapd/daemon.c @@ -749,7 +749,7 @@ daemon_serviceloop(SOCKET sockctrl, int isactive, char *passiveClients, { sock_geterror("select failed: ", errmsgbuf, PCAP_ERRBUF_SIZE); if (rpcap_senderror(pars.sockctrl, pars.ssl, - header.ver, PCAP_ERR_NETW, + 0, PCAP_ERR_NETW, errmsgbuf, errbuf) == -1) rpcapd_log(LOGPRIO_ERROR, "Send to client failed: %s", errbuf); goto end; @@ -760,8 +760,7 @@ daemon_serviceloop(SOCKET sockctrl, int isactive, char *passiveClients, if (retval == 0) { if (rpcap_senderror(pars.sockctrl, pars.ssl, - header.ver, - PCAP_ERR_INITTIMEOUT, + 0, PCAP_ERR_INITTIMEOUT, "The RPCAP initial timeout has expired", errbuf) == -1) rpcapd_log(LOGPRIO_ERROR, "Send to client failed: %s", errbuf);