ospf6d: fix decimal area ID cli

Not all numbers are dotted quads

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2017-05-17 20:31:19 +00:00
parent 56b6674bc0
commit a27cb3cfe9

View File

@ -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; \