From a27cb3cfe901d4f1378116bc91e6656aaed7c74c Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 17 May 2017 20:31:19 +0000 Subject: [PATCH] ospf6d: fix decimal area ID cli Not all numbers are dotted quads Signed-off-by: Quentin Young --- ospf6d/ospf6_area.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index bbab8598b8..1691e501f8 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -406,26 +406,11 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa) } -#define OSPF6_CMD_AREA_LOOKUP(str, oa) \ -{ \ - u_int32_t area_id = 0; \ - if (inet_pton (AF_INET, str, &area_id) != 1) \ - { \ - vty_out (vty, "Malformed Area-ID: %s%s", str, VNL); \ - return CMD_SUCCESS; \ - } \ - oa = ospf6_area_lookup (area_id, ospf6); \ - if (oa == NULL) \ - { \ - vty_out (vty, "No such Area: %s%s", str, VNL); \ - return CMD_SUCCESS; \ - } \ -} - #define OSPF6_CMD_AREA_GET(str, oa) \ { \ - u_int32_t area_id = 0; \ - if (inet_pton (AF_INET, str, &area_id) != 1) \ + char *ep; \ + u_int32_t area_id = htonl (strtol(str, &ep, 10)); \ + if (*ep && inet_pton (AF_INET, str, &area_id) != 1) \ { \ vty_out (vty, "Malformed Area-ID: %s%s", str, VNL); \ return CMD_SUCCESS; \