summaryrefslogtreecommitdiff
path: root/pcap-rpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-01-29 11:02:06 -0800
committerGuy Harris <guy@alum.mit.edu>2019-01-29 11:02:06 -0800
commit99dc51e5552d0d87c61644142421a2853d852694 (patch)
tree74ffafe43bc1eb10b66fdc44f42cb1e95103bcb3 /pcap-rpcap.c
parent2e907dbca3a4ab9a2a1d0289612b4f96609c35e8 (diff)
downloadlibpcap-99dc51e5552d0d87c61644142421a2853d852694.tar.gz
Check for data-over-UDP *after* we parse the URL.
Before we parse the URL, we don't know whether the URL requests TLS or not, so we don't know whether we'll need DTLS (which we currently don't support).
Diffstat (limited to 'pcap-rpcap.c')
-rw-r--r--pcap-rpcap.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/pcap-rpcap.c b/pcap-rpcap.c
index 88c4e75f..d4ff3f99 100644
--- a/pcap-rpcap.c
+++ b/pcap-rpcap.c
@@ -2215,16 +2215,6 @@ pcap_t *pcap_open_rpcap(const char *source, int snaplen, int flags, int read_tim
pr = fp->priv;
pr->rmt_flags = flags;
- // Also, SSL is not supported with UDP at the moment, so if the user
- // asks for both we'd better bail out now:
- if (pr->uses_ssl && (pr->rmt_flags & PCAP_OPENFLAG_DATATX_UDP))
- {
- pcap_close(fp);
- pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "SSL not supported with UDP forward of remote packets");
- return NULL;
- }
-
/*
* determine the type of the source (NULL, file, local, remote)
* You must have a valid source string even if we're in active mode, because otherwise
@@ -2244,6 +2234,19 @@ pcap_t *pcap_open_rpcap(const char *source, int snaplen, int flags, int read_tim
}
/*
+ * We don't yet support DTLS, so if the user asks for a TLS
+ * connection and asks for data packets to be sent over UDP,
+ * we have to give up.
+ */
+ if (pr->uses_ssl && (pr->rmt_flags & PCAP_OPENFLAG_DATATX_UDP))
+ {
+ pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE,
+ "TLS not supported with UDP forward of remote packets");
+ pcap_close(fp);
+ return NULL;
+ }
+
+ /*
* Warning: this call can be the first one called by the user.
* For this reason, we have to initialize the WinSock support.
*/