Patchwork iproute2: inform user when a neighbor is removed

login
register
mail settings
Submitter Nicolas Dichtel
Date Oct. 5, 2012, 8:02 a.m.
Message ID <1349424172-5602-1-git-send-email-nicolas.dichtel@6wind.com>
Download mbox | patch
Permalink /patch/189426/
State Accepted
Delegated to: stephen hemminger
Headers show

Comments

Nicolas Dichtel - Oct. 5, 2012, 8:02 a.m.
When running 'ip monitor neigh', there is no hint to tell if a neighbor is
updated or deleted.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 ip/ipneigh.c | 2 ++
 1 file changed, 2 insertions(+)
stephen hemminger - Oct. 8, 2012, 4:49 p.m.
On Fri,  5 Oct 2012 10:02:52 +0200
Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:

> When running 'ip monitor neigh', there is no hint to tell if a neighbor is
> updated or deleted.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---

Applied
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/ip/ipneigh.c b/ip/ipneigh.c
index 93cfba2..56e56b2 100644
--- a/ip/ipneigh.c
+++ b/ip/ipneigh.c
@@ -249,6 +249,8 @@  int print_neigh(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 			return 0;
 	}
 
+	if (n->nlmsg_type == RTM_DELNEIGH)
+		fprintf(fp, "delete ");
 	if (tb[NDA_DST]) {
 		fprintf(fp, "%s ",
 			format_host(r->ndm_family,