aboutsummaryrefslogtreecommitdiff
path: root/pcap-tc.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcap-tc.c')
-rw-r--r--pcap-tc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pcap-tc.c b/pcap-tc.c
index bedb4f6e..a4cde6c0 100644
--- a/pcap-tc.c
+++ b/pcap-tc.c
@@ -572,6 +572,17 @@ TcActivate(pcap_t *p)
}
/*
+ * Turn a negative snapshot value (invalid), a snapshot value of
+ * 0 (unspecified), or a value bigger than the normal maximum
+ * value, into the maximum allowed value.
+ *
+ * If some application really *needs* a bigger snapshot
+ * length, we should just increase MAXIMUM_SNAPLEN.
+ */
+ if (p->snapshot <= 0 || p->snapshot > MAXIMUM_SNAPLEN)
+ p->snapshot = MAXIMUM_SNAPLEN;
+
+ /*
* Initialize the PPI fixed fields
*/
pPpiHeader = (PPPI_HEADER)pt->PpiPacket;