diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-10-20 16:09:30 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-22 02:26:11 +0100 |
commit | eaa54bdb6729bbe97d938e70ee5580dcad666f0f (patch) | |
tree | d2044c0458b40729fd1bcaa31340079784b362be /pimd/pim_sock.c | |
parent | pimd: add support for IGMPv2 (diff) | |
download | frr-eaa54bdb6729bbe97d938e70ee5580dcad666f0f.tar.xz frr-eaa54bdb6729bbe97d938e70ee5580dcad666f0f.zip |
pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_sock.c')
-rw-r--r-- | pimd/pim_sock.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index 8ba514a21..681b5fe5c 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -269,8 +269,8 @@ int pim_socket_join(int fd, struct in_addr group, ret = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &opt, sizeof(opt)); if (ret) { - char group_str[100]; - char ifaddr_str[100]; + char group_str[INET_ADDRSTRLEN]; + char ifaddr_str[INET_ADDRSTRLEN]; if (!inet_ntop(AF_INET, &group, group_str , sizeof(group_str))) sprintf(group_str, "<group?>"); if (!inet_ntop(AF_INET, &ifaddr, ifaddr_str , sizeof(ifaddr_str))) @@ -282,8 +282,8 @@ int pim_socket_join(int fd, struct in_addr group, } if (PIM_DEBUG_TRACE) { - char group_str[100]; - char ifaddr_str[100]; + char group_str[INET_ADDRSTRLEN]; + char ifaddr_str[INET_ADDRSTRLEN]; if (!inet_ntop(AF_INET, &group, group_str , sizeof(group_str))) sprintf(group_str, "<group?>"); if (!inet_ntop(AF_INET, &ifaddr, ifaddr_str , sizeof(ifaddr_str))) @@ -302,8 +302,8 @@ int pim_socket_join_source(int fd, ifindex_t ifindex, const char *ifname) { if (pim_igmp_join_source(fd, ifindex, group_addr, source_addr)) { - char group_str[100]; - char source_str[100]; + char group_str[INET_ADDRSTRLEN]; + char source_str[INET_ADDRSTRLEN]; pim_inet4_dump("<grp?>", group_addr, group_str, sizeof(group_str)); pim_inet4_dump("<src?>", source_addr, source_str, sizeof(source_str)); zlog_warn("%s: setsockopt(fd=%d) failure for IGMP group %s source %s ifindex %d on interface %s: errno=%d: %s", @@ -380,7 +380,7 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len, *ifindex = i->ipi_ifindex; if (to && PIM_DEBUG_PACKETS) { - char to_str[100]; + char to_str[INET_ADDRSTRLEN]; pim_inet4_dump("<to?>", to->sin_addr, to_str, sizeof(to_str)); zlog_debug("%s: HAVE_IP_PKTINFO to=%s,%d", __PRETTY_FUNCTION__, @@ -400,7 +400,7 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len, *tolen = sizeof(struct sockaddr_in); if (to && PIM_DEBUG_PACKETS) { - char to_str[100]; + char to_str[INET_ADDRSTRLEN]; pim_inet4_dump("<to?>", to->sin_addr, to_str, sizeof(to_str)); zlog_debug("%s: HAVE_IP_RECVDSTADDR to=%s,%d", __PRETTY_FUNCTION__, |