From 1bb9c968ed1902bedb5ddfc899b51d3b88308223 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Mon, 27 Nov 2017 13:45:27 +0100 Subject: [PATCH] shell_commands: add interface to `nib neigh del` command Neighbors are identified by an (IPv6 address, interface)-tuple so it makes sense to also remove them by this. --- sys/shell/commands/sc_gnrc_ipv6_nib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/shell/commands/sc_gnrc_ipv6_nib.c b/sys/shell/commands/sc_gnrc_ipv6_nib.c index ef2a55999a..599aae829c 100644 --- a/sys/shell/commands/sc_gnrc_ipv6_nib.c +++ b/sys/shell/commands/sc_gnrc_ipv6_nib.c @@ -56,7 +56,7 @@ static void _usage_nib_neigh(char **argv) { printf("usage: %s %s [show|add|del|help]\n", argv[0], argv[1]); printf(" %s %s add []\n", argv[0], argv[1]); - printf(" %s %s del \n", argv[0], argv[1]); + printf(" %s %s del \n", argv[0], argv[1]); printf(" %s %s show [iface]\n", argv[0], argv[1]); } @@ -114,11 +114,13 @@ static int _nib_neigh(int argc, char **argv) } else if ((argc > 3) && (strcmp(argv[2], "del") == 0)) { ipv6_addr_t ipv6_addr; + unsigned iface = atoi(argv[3]); - if (ipv6_addr_from_str(&ipv6_addr, argv[3]) == NULL) { + if (ipv6_addr_from_str(&ipv6_addr, argv[4]) == NULL) { _usage_nib_neigh(argv); return 1; } + (void)iface; gnrc_ipv6_nib_nc_del(&ipv6_addr); } else {