aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-07-07 04:45:05 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2013-07-07 04:45:05 +0200
commit1a350aacfe2f10439cb197c2a6b09bc6f43c15b0 (patch)
treea3bba62e4c363e0794ebb6c8ebf54b360c595a76
parenttraceroute improvements (diff)
downloadglouglou-1a350aacfe2f10439cb197c2a6b09bc6f43c15b0.tar.xz
glouglou-1a350aacfe2f10439cb197c2a6b09bc6f43c15b0.zip
gg_sniff: don't send empty traceroute hops
-rw-r--r--gg_sniff/pcap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gg_sniff/pcap.c b/gg_sniff/pcap.c
index d5e5809..5a247d6 100644
--- a/gg_sniff/pcap.c
+++ b/gg_sniff/pcap.c
@@ -372,11 +372,13 @@ cb_nodetraceroute(struct ggnet *net, struct ggnet_traceroute_req *req)
pkt.trace_addr = req->target->ip.addr_ip;
pkt.trace_src = req->srcip.addr_ip;
printf("XXX oooooooooooooooooo %x\n", pkt.trace_addr);
- pkt.trace_hopcount = req->hopcount_total;
+ pkt.trace_hopcount = req->hopcount_answering;
i = 0;
TAILQ_FOREACH(h, &req->hops_list, entry) {
//inet_aton(addr_ntoa(&h->ip), &ip);
//pkt.trace_hops[i].addr = ip.s_addr;
+ if (h->ip.addr_ip == 0)
+ continue;
pkt.trace_hops[i].addr = ntohl(h->ip.addr_ip);
printf("XXX ------------------- %x\n", pkt.trace_hops[i].addr);
pkt.trace_hops[i].delay = h->delay;