summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_area.h
diff options
context:
space:
mode:
authorPatrick Ruddy <pruddy@vyatta.att-mail.com>2018-10-03 19:22:34 +0200
committerDuncan Eastoe <duncan.eastoe@att.com>2020-07-14 18:50:54 +0200
commitde842255f9a1930d7f927e94e7ea800bcfd1434c (patch)
treef670b8afc747cd09f356dd00bae2803d202f463b /ospf6d/ospf6_area.h
parentMerge pull request #6721 from kuldeepkash/bgp_basic_functionality (diff)
downloadfrr-de842255f9a1930d7f927e94e7ea800bcfd1434c.tar.xz
frr-de842255f9a1930d7f927e94e7ea800bcfd1434c.zip
ospf6d: decimal area format in interface command
The ospf6 "interface <blah> area <x>" command only allows the area to be specified in the ipv4 address format, whereas the show run command always shows it in the format in which the area was created. This causes the frr-reload script to be unable to remove ospfv3 interfaces when the area was created in decimal format. The solution is to allow both formats to be configured as they can be for other area commands. Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
Diffstat (limited to 'ospf6d/ospf6_area.h')
-rw-r--r--ospf6d/ospf6_area.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ospf6d/ospf6_area.h b/ospf6d/ospf6_area.h
index 5648b1dfe..7ce6717fc 100644
--- a/ospf6d/ospf6_area.h
+++ b/ospf6d/ospf6_area.h
@@ -117,6 +117,21 @@ struct ospf6_area {
#define IS_AREA_TRANSIT(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_TRANSIT))
#define IS_AREA_STUB(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_STUB))
+#define OSPF6_CMD_AREA_GET(str, oa) \
+ { \
+ char *ep; \
+ uint32_t area_id = htonl(strtoul(str, &ep, 10)); \
+ if (*ep && inet_pton(AF_INET, str, &area_id) != 1) { \
+ vty_out(vty, "Malformed Area-ID: %s\n", str); \
+ return CMD_SUCCESS; \
+ } \
+ int format = !*ep ? OSPF6_AREA_FMT_DECIMAL \
+ : OSPF6_AREA_FMT_DOTTEDQUAD; \
+ oa = ospf6_area_lookup(area_id, ospf6); \
+ if (oa == NULL) \
+ oa = ospf6_area_create(area_id, ospf6, format); \
+ }
+
/* prototypes */
extern int ospf6_area_cmp(void *va, void *vb);