From 6ed895d4c7933ca9494e1e164e0ec2c05a5628e3 Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Thu, 23 Feb 2017 18:29:55 +0100 Subject: [PATCH] Log bogus NMRP responses --- nmrp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nmrp.c b/nmrp.c index 1f197ea..722fe75 100644 --- a/nmrp.c +++ b/nmrp.c @@ -488,8 +488,14 @@ int nmrp_do(struct nmrpd_args *args) } status = pkt_recv(sock, &rx); - if (status == 0 && memcmp(rx.eh.ether_dhost, src, 6) == 0) { - break; + if (status == 0) { + if (memcmp(rx.eh.ether_dhost, src, 6) == 0) { + break; + } else if (verbosity) { + printf("\nIgnoring bogus response: %s -> %s.\n", + mac_to_str(rx.eh.ether_shost), + mac_to_str(rx.eh.ether_dhost)); + } } else if (status == 1) { goto out; } else { -- 2.25.1