diff options
Diffstat (limited to 'networking/libiproute/ipaddress.c')
-rw-r--r-- | networking/libiproute/ipaddress.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index c0f27c7..5c975d8 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c @@ -214,8 +214,7 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM, { struct ifaddrmsg *ifa = NLMSG_DATA(n); int len = n->nlmsg_len; - struct rtattr * rta_tb[IFA_MAX+1]; - char abuf[256]; + struct rtattr *rta_tb[IFA_MAX+1]; if (n->nlmsg_type != RTM_NEWADDR && n->nlmsg_type != RTM_DELADDR) return 0; @@ -291,9 +290,9 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM, printf(" family %d ", ifa->ifa_family); if (rta_tb[IFA_LOCAL]) { - fputs(rt_addr_n2a(ifa->ifa_family, - RTA_DATA(rta_tb[IFA_LOCAL]), - abuf, sizeof(abuf)), stdout); + fputs(rt_addr_n2a(ifa->ifa_family, RTA_DATA(rta_tb[IFA_LOCAL])), + stdout + ); if (rta_tb[IFA_ADDRESS] == NULL || memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_LOCAL]), 4) == 0 @@ -301,25 +300,22 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM, printf("/%d ", ifa->ifa_prefixlen); } else { printf(" peer %s/%d ", - rt_addr_n2a(ifa->ifa_family, - RTA_DATA(rta_tb[IFA_ADDRESS]), - abuf, sizeof(abuf)), - ifa->ifa_prefixlen); + rt_addr_n2a(ifa->ifa_family, RTA_DATA(rta_tb[IFA_ADDRESS])), + ifa->ifa_prefixlen + ); } } if (rta_tb[IFA_BROADCAST]) { printf("brd %s ", rt_addr_n2a(ifa->ifa_family, - RTA_DATA(rta_tb[IFA_BROADCAST]), - abuf, sizeof(abuf)) + RTA_DATA(rta_tb[IFA_BROADCAST])) ); } if (rta_tb[IFA_ANYCAST]) { printf("any %s ", rt_addr_n2a(ifa->ifa_family, - RTA_DATA(rta_tb[IFA_ANYCAST]), - abuf, sizeof(abuf)) + RTA_DATA(rta_tb[IFA_ANYCAST])) ); } printf("scope %s ", rtnl_rtscope_n2a(ifa->ifa_scope)); |