summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpdw <>2011-10-03 20:09:06 +0000
committerpdw <>2011-10-03 20:09:06 +0000
commitcd57e7672730bfb08bf087d090601e168e7d69d7 (patch)
tree232ae5380ad902daddb649caebc625ceac74850e
parent970508628b0067fea1f827a362ee53f0cedcf034 (diff)
downloadiftop-cd57e7672730bfb08bf087d090601e168e7d69d7.zip
Patch for DLT_NULL. Scott Bertilson <ssb@umn.edu>
-rw-r--r--iftop.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/iftop.c b/iftop.c
index 0c233cf..d372180 100644
--- a/iftop.c
+++ b/iftop.c
@@ -449,6 +449,11 @@ static void handle_pflog_packet(unsigned char* args, const struct pcap_pkthdr* p
}
#endif
+static void handle_loopback_packet(unsigned char* args, const struct pcap_pkthdr* pkthdr, const unsigned char* packet)
+{
+ handle_ip_packet((struct ip*)(packet + 4), -1);
+}
+
static void handle_llc_packet(const struct llc* llc, int dir) {
struct ip* ip = (struct ip*)((void*)llc + sizeof(struct llc));
@@ -682,9 +687,12 @@ void packet_init() {
packet_handler = handle_pflog_packet;
}
#endif
- else if(dlt == DLT_RAW || dlt == DLT_NULL) {
+ else if(dlt == DLT_RAW) {
packet_handler = handle_raw_packet;
}
+ else if(dlt == DLT_NULL) {
+ packet_handler = handle_loopback_packet;
+ }
else if(dlt == DLT_IEEE802) {
packet_handler = handle_tokenring_packet;
}