]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-dbus.c
Clean up the ether_hostton() stuff.
[libpcap] / pcap-dbus.c
index ea3a390ff55c0ab8f65d7dbc0e72e6e198cefa7f..b1fb548ff4b3f1dc336d628415037bcc7e29f08f 100644 (file)
@@ -29,7 +29,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <string.h>
@@ -223,6 +223,14 @@ dbus_activate(pcap_t *handle)
                return PCAP_ERROR_RFMON_NOTSUP;
        }
 
+       /*
+        * Turn a negative snapshot value (invalid), a snapshot value of
+        * 0 (unspecified), or a value bigger than the normal maximum
+        * value, into the maximum message length for D-Bus (128MB).
+        */
+       if (handle->snapshot <= 0 || handle->snapshot > 134217728)
+               handle->snapshot = 134217728;
+
        /* dbus_connection_set_max_message_size(handlep->conn, handle->snapshot); */
        if (handle->opt.buffer_size != 0)
                dbus_connection_set_max_received_size(handlep->conn, handle->opt.buffer_size);