From 8cb40c91cdfb00ddf04e88d3ecd40403890d90f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Wed, 30 Mar 2016 13:44:03 +0300 Subject: cumulus take-3 --- zebra/interface.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index 8a9225ac..4ba92ba8 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -632,12 +632,30 @@ connected_dump_vty (struct vty *vty, struct connected *connected) if (CHECK_FLAG (connected->flags, ZEBRA_IFA_SECONDARY)) vty_out (vty, " secondary"); + if (CHECK_FLAG (connected->flags, ZEBRA_IFA_UNNUMBERED)) + vty_out (vty, " unnumbered"); + if (connected->label) vty_out (vty, " %s", connected->label); vty_out (vty, "%s", VTY_NEWLINE); } +/* Dump interface neighbor address information to vty. */ +static void +nbr_connected_dump_vty (struct vty *vty, struct nbr_connected *connected) +{ + struct prefix *p; + + /* Print interface address. */ + p = connected->address; + vty_out (vty, " %s ", prefix_family_str (p)); + prefix_vty_out (vty, p); + vty_out (vty, "/%d", p->prefixlen); + + vty_out (vty, "%s", VTY_NEWLINE); +} + #if defined (HAVE_RTADV) /* Dump interface ND information to vty. */ static void @@ -706,6 +724,7 @@ static void if_dump_vty (struct vty *vty, struct interface *ifp) { struct connected *connected; + struct nbr_connected *nbr_connected; struct listnode *node; struct route_node *rn; struct zebra_if *zebra_if; @@ -793,6 +812,10 @@ if_dump_vty (struct vty *vty, struct interface *ifp) #if defined (HAVE_RTADV) nd_dump_vty (vty, ifp); #endif /* HAVE_RTADV */ + if (listhead(ifp->nbr_connected)) + vty_out (vty, " Neighbor address(s):%s", VTY_NEWLINE); + for (ALL_LIST_ELEMENTS_RO (ifp->nbr_connected, node, nbr_connected)) + nbr_connected_dump_vty (vty, nbr_connected); #ifdef HAVE_PROC_NET_DEV /* Statistics print out using proc file system. */ @@ -1381,6 +1404,12 @@ ip_address_install (struct vty *vty, struct interface *ifp, return CMD_WARNING; } + if (ipv4_martian(&cp.prefix)) + { + vty_out (vty, "%% Invalid address%s", VTY_NEWLINE); + return CMD_WARNING; + } + ifc = connected_check (ifp, (struct prefix *) &cp); if (! ifc) { @@ -1565,6 +1594,12 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, return CMD_WARNING; } + if (ipv6_martian(&cp.prefix)) + { + vty_out (vty, "%% Invalid address%s", VTY_NEWLINE); + return CMD_WARNING; + } + ifc = connected_check (ifp, (struct prefix *) &cp); if (! ifc) { -- cgit v1.2.3