-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix BPF filter for ICMPv6 and use shorter form - Add tests for ICMP and ICMP6
- Loading branch information
Showing
6 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import sys | ||
from scapy.all import * | ||
|
||
pcap = sys.argv[1] | ||
|
||
pkts = [] | ||
pkts.append(Ether()/IPv6(dst="2001:db8:dead::1")/ICMPv6DestUnreach()) | ||
pkts.append(Ether()/IP(dst="0.0.0.0")/ICMP(type=3)) | ||
|
||
wrpcap(pcap, pkts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[48] 2024-09-10 08:52:52.252793 [#0 icmp.pcap 4095] \ | ||
[fd00::242:ac11:9].0 [2001:db8:dead::1].0 | ||
[28] 2024-09-10 08:52:52.253461 [#1 icmp.pcap 4095] \ | ||
[172.17.0.9].0 [0.0.0.0].0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh -xe | ||
|
||
test -e icmp.pcap || ln -s "$srcdir/icmp.pcap" icmp.pcap | ||
|
||
../dnscap -g -I -r icmp.pcap 2>test_icmp.out | ||
|
||
mv test_icmp.out test_icmp.out.old | ||
grep -v "^libgcov profiling error:" test_icmp.out.old > test_icmp.out | ||
rm test_icmp.out.old | ||
|
||
diff test_icmp.out "$srcdir/icmp.gold" |