summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-05-17 20:31:19 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-05-18 04:35:31 +0000
commita27cb3cfe901d4f1378116bc91e6656aaed7c74c (patch)
tree001fe9468ca21f764cb6b751e51259c834bcbbfd
parent56b6674bc0f774168ea5e8330a7d8c3cb382d0e0 (diff)
ospf6d: fix decimal area ID cli
Not all numbers are dotted quads Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--ospf6d/ospf6_area.c21
1 files 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; \