summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_top.c
diff options
context:
space:
mode:
authorPatrick Ruddy <pruddy@vyatta.att-mail.com>2018-10-03 18:22:34 +0100
committerDuncan Eastoe <duncan.eastoe@att.com>2020-07-14 17:50:54 +0100
commitde842255f9a1930d7f927e94e7ea800bcfd1434c (patch)
treef670b8afc747cd09f356dd00bae2803d202f463b /ospf6d/ospf6_top.c
parent909a8a3fc254c15bc460ea83df2455b1ff1a2622 (diff)
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_top.c')
-rw-r--r--ospf6d/ospf6_top.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index dd672dd1c5..f49ea9add2 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -644,11 +644,12 @@ DEFUN (no_ospf6_distance_source,
DEFUN (ospf6_interface_area,
ospf6_interface_area_cmd,
- "interface IFNAME area A.B.C.D",
+ "interface IFNAME area <A.B.C.D|(0-4294967295)>",
"Enable routing on an IPv6 interface\n"
IFNAME_STR
"Specify the OSPF6 area ID\n"
"OSPF6 area ID in IPv4 address notation\n"
+ "OSPF6 area ID in decimal notation\n"
)
{
VTY_DECLVAR_CONTEXT(ospf6, o);
@@ -657,7 +658,6 @@ DEFUN (ospf6_interface_area,
struct ospf6_area *oa;
struct ospf6_interface *oi;
struct interface *ifp;
- uint32_t area_id;
/* find/create ospf6 interface */
ifp = if_get_by_name(argv[idx_ifname]->arg, VRF_DEFAULT);
@@ -671,15 +671,7 @@ DEFUN (ospf6_interface_area,
}
/* parse Area-ID */
- if (inet_pton(AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) {
- vty_out(vty, "Invalid Area-ID: %s\n", argv[idx_ipv4]->arg);
- return CMD_SUCCESS;
- }
-
- /* find/create ospf6 area */
- oa = ospf6_area_lookup(area_id, o);
- if (oa == NULL)
- oa = ospf6_area_create(area_id, o, OSPF6_AREA_FMT_DOTTEDQUAD);
+ OSPF6_CMD_AREA_GET(argv[idx_ipv4]->arg, oa);
/* attach interface to area */
listnode_add(oa->if_list, oi); /* sort ?? */
@@ -703,12 +695,13 @@ DEFUN (ospf6_interface_area,
DEFUN (no_ospf6_interface_area,
no_ospf6_interface_area_cmd,
- "no interface IFNAME area A.B.C.D",
+ "no interface IFNAME area <A.B.C.D|(0-4294967295)>",
NO_STR
"Disable routing on an IPv6 interface\n"
IFNAME_STR
"Specify the OSPF6 area ID\n"
"OSPF6 area ID in IPv4 address notation\n"
+ "OSPF6 area ID in decimal notation\n"
)
{
int idx_ifname = 2;
@@ -731,10 +724,8 @@ DEFUN (no_ospf6_interface_area,
}
/* parse Area-ID */
- if (inet_pton(AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) {
- vty_out(vty, "Invalid Area-ID: %s\n", argv[idx_ipv4]->arg);
- return CMD_SUCCESS;
- }
+ if (inet_pton(AF_INET, argv[idx_ipv4]->arg, &area_id) != 1)
+ area_id = htonl(strtoul(argv[idx_ipv4]->arg, NULL, 10));
/* Verify Area */
if (oi->area == NULL) {