summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpdw <>2014-01-01 14:40:44 +0000
committerpdw <>2014-01-01 14:40:44 +0000
commita5557a1bcf54049255ba04e0d600ea8ddf93fbaf (patch)
tree96f8d7c9362263161ee76af66eebba0875afe385
parenta9663192567697bfb217704cd67c34fd32a68389 (diff)
downloadiftop-a5557a1bcf54049255ba04e0d600ea8ddf93fbaf.zip
Treat multicast packets as incoming, rather than incoming (IPv4) or not at all
(IPv6). Patch by Andreas Schwab <schwab@linux-m68k.org>
-rw-r--r--iftop.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/iftop.c b/iftop.c
index 3c7e58a..1e9f910 100644
--- a/iftop.c
+++ b/iftop.c
@@ -305,6 +305,14 @@ static void handle_ip_packet(struct ip* iptr, int hw_dir)
assign_addr_pair(&ap, iptr, 1);
direction = 0;
}
+ else if (IP_V(iptr) == 4 && IN_MULTICAST(iptr->ip_dst.s_addr)) {
+ assign_addr_pair(&ap, iptr, 1);
+ direction = 0;
+ }
+ else if (IP_V(iptr) == 6 && IN6_IS_ADDR_MULTICAST(&ip6tr->ip6_dst)) {
+ assign_addr_pair(&ap, iptr, 1);
+ direction = 0;
+ }
/*
* Cannot determine direction from hardware or IP levels. Therefore
* assume that it was a packet between two other machines, assign
@@ -323,6 +331,8 @@ static void handle_ip_packet(struct ip* iptr, int hw_dir)
direction = 0;
}
/* Drop other uncertain packages. */
+ else
+ return;
}
if(IP_V(iptr) == 4 && options.netfilter != 0) {