summaryrefslogtreecommitdiff
path: root/rpcapd/daemon.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-11-25 03:03:58 -0800
committerGuy Harris <guy@alum.mit.edu>2017-11-25 03:03:58 -0800
commit325169d168b366010d3d34adb5b4e07c2e55248e (patch)
treebc88f5232055458d9c0b21b26ea2dd159e408a72 /rpcapd/daemon.c
parente19d1c772e1ed6d4fc81dfeb676416c9e1721005 (diff)
downloadlibpcap-325169d168b366010d3d34adb5b4e07c2e55248e.tar.gz
Suppress warnings if RPCAP_MIN_VERSION is 0.
Version numbers are unsigned, so they can never be < 0, so checking whether a version is less than the minimum supported version will never fail.
Diffstat (limited to 'rpcapd/daemon.c')
-rwxr-xr-xrpcapd/daemon.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/rpcapd/daemon.c b/rpcapd/daemon.c
index 58314f8b..f5255cdf 100755
--- a/rpcapd/daemon.c
+++ b/rpcapd/daemon.c
@@ -237,14 +237,19 @@ void *daemon_serviceloop(void *ptr)
//
// Did the client specify a version we can handle?
//
- if (header.ver < RPCAP_MIN_VERSION ||
- header.ver > RPCAP_MAX_VERSION)
+ if (RPCAP_VERSION_IS_SUPPORTED(header.ver))
{
//
// Tell them it's not a valid protocol version.
//
uint8 reply_version;
+ //
+ // If RPCAP_MIN_VERSION is 0, no version is too
+ // old, as the oldest supported version is 0,
+ // and there are no negative versions.
+ //
+#if RPCAP_MIN_VERSION != 0
if (header.ver < RPCAP_MIN_VERSION)
{
//
@@ -261,6 +266,7 @@ void *daemon_serviceloop(void *ptr)
reply_version = header.ver;
}
else
+#endif
{
//
// Their maximum version is too new,