diff options
author | David Lamparter <equinox@diac24.net> | 2009-03-21 20:55:22 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-04 02:57:05 +0100 |
commit | a2455c1bb173b6f75529e7163b44937dd3d51bff (patch) | |
tree | ef799c7fac243540797976c9421d6c2965691f40 | |
parent | 5df860f6602ac8603c9910fe3ff17f721b974e8e (diff) | |
download | quagga-a2455c1bb173b6f75529e7163b44937dd3d51bff.tar.bz2 quagga-a2455c1bb173b6f75529e7163b44937dd3d51bff.tar.xz |
dn42: bgpd: always display IP subnets with netmask
from ht-20040304-classless-bgp_adapted.patch, removes special
treatment of classful netmasks.
-rw-r--r-- | bgpd/bgp_route.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index a92ca4e2..0bc9ad8a 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5613,23 +5613,7 @@ route_vty_out_route (struct prefix *p, struct vty *vty) u_int32_t destination; char buf[BUFSIZ]; - if (p->family == AF_INET) - { - len = vty_out (vty, "%s", inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ)); - destination = ntohl (p->u.prefix4.s_addr); - - if ((IN_CLASSC (destination) && p->prefixlen == 24) - || (IN_CLASSB (destination) && p->prefixlen == 16) - || (IN_CLASSA (destination) && p->prefixlen == 8) - || p->u.prefix4.s_addr == 0) - { - /* When mask is natural, mask is not displayed. */ - } - else - len += vty_out (vty, "/%d", p->prefixlen); - } - else - len = vty_out (vty, "%s/%d", inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), + len = vty_out (vty, "%s/%d", inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen); len = 17 - len; @@ -11521,18 +11505,9 @@ bgp_config_write_network (struct vty *vty, struct bgp *bgp, destination = ntohl (p->u.prefix4.s_addr); masklen2ip (p->prefixlen, &netmask); - vty_out (vty, " network %s", - inet_ntop (p->family, &p->u.prefix, buf, SU_ADDRSTRLEN)); - - if ((IN_CLASSC (destination) && p->prefixlen == 24) - || (IN_CLASSB (destination) && p->prefixlen == 16) - || (IN_CLASSA (destination) && p->prefixlen == 8) - || p->u.prefix4.s_addr == 0) - { - /* Natural mask is not display. */ - } - else - vty_out (vty, " mask %s", inet_ntoa (netmask)); + vty_out (vty, " network %s mask %s", + inet_ntop (p->family, &p->u.prefix, buf, SU_ADDRSTRLEN), + inet_ntoa (netmask)); } else { |