diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-04-28 14:28:00 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2009-06-18 20:18:27 +0100 |
commit | 81cce0185e23b6ecd2ab98ab34182901226bcf9e (patch) | |
tree | 24a8fa282d80b9dab623bb26fbbec731c0c8b34a /zebra/interface.c | |
parent | 82f5ee1ead0aa83f83f918abfc3f5071741a56e5 (diff) |
[cleanup] Use correct buffer size for inet_ntop()
Don't need big buffer 1024 to hold IPV4 (INET_ADDRSTRLEN)
or IPv6 (INET6_ADDRSTRLEN) message.
Diffstat (limited to 'zebra/interface.c')
-rw-r--r-- | zebra/interface.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 9cbbf937..3e4867c4 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1513,7 +1513,6 @@ if_config_write (struct vty *vty) { struct listnode *node; struct interface *ifp; - char buf[BUFSIZ]; for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) { @@ -1543,10 +1542,11 @@ if_config_write (struct vty *vty) { if (CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED)) { + char buf[INET6_ADDRSTRLEN]; p = ifc->address; vty_out (vty, " ip%s address %s/%d", p->family == AF_INET ? "" : "v6", - inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), + inet_ntop (p->family, &p->u.prefix, buf, sizeof(buf)), p->prefixlen); if (ifc->label) |