diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-08-15 22:47:02 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-08-16 17:18:11 +0200 |
commit | 5ed0add5e401fce563860f6afb69fdb33d115860 (patch) | |
tree | d62f26665562d43997194ec017929c70424a7aa5 /ospfd/ospf_vty.c | |
parent | Merge pull request #983 from opensourcerouting/vtysh-watchfrr-no-conf (diff) | |
download | frr-5ed0add5e401fce563860f6afb69fdb33d115860.tar.xz frr-5ed0add5e401fce563860f6afb69fdb33d115860.zip |
ospfd: remember area-id format for ifaces
Display dotted quad or decimal back in the config depending on what the
user enters.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r-- | ospfd/ospf_vty.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 13d4780db..d9354e0cb 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -6971,6 +6971,7 @@ DEFUN (ip_ospf_area, /* enable ospf on this interface with area_id */ SET_IF_PARAM(params, if_area); params->if_area = area_id; + params->if_area_id_fmt = format; ospf_interface_area_set(ifp); ospf->if_ospf_cli_count++; @@ -8312,8 +8313,13 @@ static int config_write_interface(struct vty *vty) else vty_out(vty, " ip ospf"); - vty_out(vty, " area %s", - inet_ntoa(params->if_area)); + + size_t buflen = MAX(strlen("4294967295"), + strlen("255.255.255.255")); + char buf[buflen]; + area_id2str(buf, sizeof(buf), ¶ms->if_area, + params->if_area_id_fmt); + vty_out(vty, " area %s", buf); if (params != IF_DEF_PARAMS(ifp)) vty_out(vty, " %s", inet_ntoa(rn->p.u.prefix4)); |