Compare commits

...

2 Commits

Author SHA1 Message Date
Robert McMahon 8c9487984a Fix regression: use temp file for tshark output parsing
- Write tshark output to temp file first to avoid pipe issues
- Redirect stderr to /dev/null to suppress field errors
- Filter to only keep lines starting with frame numbers
- This should fix the issue where only 1 packet was parsed instead of 217

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 14:37:41 -08:00
Robert McMahon b01098a613 Fix regression: improve packet parsing robustness
- Filter output to only keep lines starting with frame numbers
- Remove complex error filtering that was removing valid packet data
- Use head to limit output size
- This should fix the issue where only 1 packet was parsed instead of 217

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 14:37:29 -08:00
1 changed files with 8 additions and 2 deletions

View File

@ -196,7 +196,9 @@ fi
# Now parse the pcap file to extract fields
# Only extract 802.11 header fields - data payloads are encrypted
# Include PHY rate and MCS for histograms
CAPTURE_OUTPUT=$(tshark -q -r "$TEMP_PCAP" -n -T fields \
# Extract to temp file first to avoid pipe issues, then filter
TEMP_TSHARK_OUTPUT=$(mktemp /tmp/tshark_output_XXXXXX.txt)
tshark -q -r "$TEMP_PCAP" -n -T fields \
-e frame.number \
-e frame.time \
-e wlan.ra \
@ -212,7 +214,11 @@ CAPTURE_OUTPUT=$(tshark -q -r "$TEMP_PCAP" -n -T fields \
-e radiotap.mcs.index \
-e wlan_radio.data_rate \
-e wlan_radio.mcs.index \
2>&1 | grep -v "^tshark:" | grep -v "^Running as" | grep -v "^Capturing" || true)
2>/dev/null > "$TEMP_TSHARK_OUTPUT" || true
# Filter out non-packet lines (keep only lines starting with frame numbers)
CAPTURE_OUTPUT=$(grep -E '^[0-9]+\t' "$TEMP_TSHARK_OUTPUT" || true)
rm -f "$TEMP_TSHARK_OUTPUT"
# Clean up temp file (unless KEEP_PCAP is set)
if [ -z "$KEEP_PCAP" ]; then