From 6d681bd874dc7dee4300a5d3a5ced8bb1a679643 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Fri, 16 Dec 2016 05:39:44 +0000 Subject: all: use ->text when parsing protocol argument and match on full protocol name in proto_redistnum() Signed-off-by: Quentin Young --- ripngd/ripng_zebra.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ripngd') diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index 09472683d..7daa3a887 100644 --- a/ripngd/ripng_zebra.c +++ b/ripngd/ripng_zebra.c @@ -321,11 +321,12 @@ DEFUN (ripng_redistribute_type, { int type; - type = proto_redistnum(AFI_IP6, argv[2]->arg); + char *proto = argv[argc - 1]->text; + type = proto_redistnum(AFI_IP6, proto); if (type < 0) { - vty_out(vty, "Invalid type %s%s", argv[2]->arg, VTY_NEWLINE); + vty_out(vty, "Invalid type %s%s", proto, VTY_NEWLINE); return CMD_WARNING; } @@ -345,11 +346,13 @@ DEFUN (no_ripng_redistribute_type, "Pointer to route-map entries\n") { int type; - type = proto_redistnum(AFI_IP6, argv[2]->text); + + char *proto = argv[2]->text; + type = proto_redistnum(AFI_IP6, proto); if (type < 0) { - vty_out(vty, "Invalid type %s%s", argv[2]->text, VTY_NEWLINE); + vty_out(vty, "Invalid type %s%s", proto, VTY_NEWLINE); return CMD_WARNING; } -- cgit v1.2.3