Crank up the maximum frame table size to 512*2^20 packets, that being a
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 13 Dec 2011 06:45:16 +0000 (06:45 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 13 Dec 2011 06:45:16 +0000 (06:45 +0000)
small amount bigger than the maximum possible number of packets in a
NetMon file.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40174 f5534014-38df-0310-8fa8-9805f1628bb7

wiretap/netmon.c

index fa57bc3fc0150ad1c9b6b4fa6e93cfd8213dc931..674866fa176ebaa7bde39765fb3a89193b1c04b1 100644 (file)
@@ -341,10 +341,17 @@ int netmon_open(wtap *wth, int *err, gchar **err_info)
        /*
         * XXX - clamp the size of the frame table, so that we don't
         * attempt to allocate a huge frame table and fail.
-        * We shouldn't do this on 64-bit systems.
-        * We pick 64 megabytes as an arbitrary limit.
+        *
+        * Given that file offsets in the frame table are 32-bit,
+        * a NetMon file cannot be bigger than 2^32 bytes.
+        * Given that a NetMon 1.x-format packet header is 8 bytes,
+        * that means a NetMon file cannot have more than
+        * 512*2^20 packets.  We'll pick that as the limit for
+        * now; it's 1/8th of a 32-bit address space, which is
+        * probably not going to exhaust the address space all by
+        * itself, and probably won't exhaust the backing store.
         */
-       if (frame_table_size > 16*1024*1024) {
+       if (frame_table_size > 512*1024*1024) {
                *err = WTAP_ERR_UNSUPPORTED;
                *err_info = g_strdup_printf("netmon: frame table length is %u, which is larger than we support",
                    frame_table_length);