summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 3210855801..3b7d6f2432 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1296,8 +1296,6 @@ static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf)
bool print_header = true;
FOR_ALL_INTERFACES (vrf, ifp) {
- char global_pfx[PREFIX_STRLEN] = {0};
- char buf[PREFIX_STRLEN] = {0};
bool first_pfx_printed = false;
if (print_header) {
@@ -1329,17 +1327,17 @@ static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf)
if (!CHECK_FLAG(connected->flags,
ZEBRA_IFA_SECONDARY)) {
p = connected->address;
- prefix2str(p, buf, sizeof(buf));
if (first_pfx_printed) {
- /* padding to prepare row only for ip addr */
+ /* padding to prepare row only
+ * for ip addr */
vty_out(vty, "%-40s", "");
if (list_size > 1)
vty_out(vty, "+ ");
- vty_out(vty, "%s\n", buf);
+ vty_out(vty, "%pFX\n", p);
} else {
if (list_size > 1)
vty_out(vty, "+ ");
- vty_out(vty, "%s\n", buf);
+ vty_out(vty, "%pFX\n", p);
}
first_pfx_printed = true;
break;
@@ -1361,17 +1359,17 @@ static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf)
p = connected->address;
/* Don't print link local pfx */
if (!IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6)) {
- prefix2str(p, global_pfx, PREFIX_STRLEN);
if (first_pfx_printed) {
- /* padding to prepare row only for ip addr */
+ /* padding to prepare row only
+ * for ip addr */
vty_out(vty, "%-40s", "");
if (v6_list_size > 1)
vty_out(vty, "+ ");
- vty_out(vty, "%s\n", global_pfx);
+ vty_out(vty, "%pFX\n", p);
} else {
if (v6_list_size > 1)
vty_out(vty, "+ ");
- vty_out(vty, "%s\n", global_pfx);
+ vty_out(vty, "%pFX\n", p);
}
first_pfx_printed = true;
break;
@@ -1496,14 +1494,14 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
vxlan_info = &zebra_if->l2info.vxl;
vty_out(vty, " VxLAN Id %u", vxlan_info->vni);
if (vxlan_info->vtep_ip.s_addr != INADDR_ANY)
- vty_out(vty, " VTEP IP: %s",
- inet_ntoa(vxlan_info->vtep_ip));
+ vty_out(vty, " VTEP IP: %pI4",
+ &vxlan_info->vtep_ip);
if (vxlan_info->access_vlan)
vty_out(vty, " Access VLAN Id %u\n",
vxlan_info->access_vlan);
if (vxlan_info->mcast_grp.s_addr != INADDR_ANY)
- vty_out(vty, " Mcast Group %s",
- inet_ntoa(vxlan_info->mcast_grp));
+ vty_out(vty, " Mcast Group %pI4",
+ &vxlan_info->mcast_grp);
if (vxlan_info->ifindex_link &&
(vxlan_info->link_nsid != NS_UNKNOWN)) {
struct interface *ifp;
@@ -1609,8 +1607,8 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
vty_out(vty, " Utilized Bandwidth %g (Byte/s)\n",
iflp->use_bw);
if (IS_PARAM_SET(iflp, LP_RMT_AS))
- vty_out(vty, " Neighbor ASBR IP: %s AS: %u \n",
- inet_ntoa(iflp->rmt_ip), iflp->rmt_as);
+ vty_out(vty, " Neighbor ASBR IP: %pI4 AS: %u \n",
+ &iflp->rmt_ip, iflp->rmt_as);
}
hook_call(zebra_if_extra_info, vty, ifp);
@@ -3498,7 +3496,7 @@ static int link_params_config_write(struct vty *vty, struct interface *ifp)
if (IS_PARAM_SET(iflp, LP_USE_BW))
vty_out(vty, " use-bw %g\n", iflp->use_bw);
if (IS_PARAM_SET(iflp, LP_RMT_AS))
- vty_out(vty, " neighbor %s as %u\n", inet_ntoa(iflp->rmt_ip),
+ vty_out(vty, " neighbor %pI4 as %u\n", &iflp->rmt_ip,
iflp->rmt_as);
vty_out(vty, " exit-link-params\n");
return 0;