diff options
-rw-r--r-- | pimd/pim_iface.c | 3 | ||||
-rw-r--r-- | pimd/pim_igmpv3.c | 3 | ||||
-rw-r--r-- | pimd/pim_mroute.c | 30 | ||||
-rw-r--r-- | pimd/pim_pim.c | 3 | ||||
-rw-r--r-- | pimd/pim_sock.c | 3 | ||||
-rw-r--r-- | pimd/pim_ssmpingd.c | 6 | ||||
-rw-r--r-- | pimd/pim_str.c | 3 |
7 files changed, 12 insertions, 39 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index a8a1d0880..6739ce17b 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -1119,14 +1119,13 @@ int pim_if_igmp_join_del(struct interface *ifp, } if (close(ij->sock_fd)) { - int e = errno; char group_str[100]; char source_str[100]; 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: failure closing sock_fd=%d for IGMP group %s source %s on interface %s: errno=%d: %s", __PRETTY_FUNCTION__, - ij->sock_fd, group_str, source_str, ifp->name, e, safe_strerror(e)); + ij->sock_fd, group_str, source_str, ifp->name, errno, safe_strerror(errno)); /* warning only */ } listnode_delete(pim_ifp->igmp_join_list, ij); diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index 7300e6c6b..05d2699ff 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -1710,7 +1710,6 @@ void pim_igmp_send_membership_query(struct igmp_group *group, sent = sendto(fd, query_buf, msg_size, MSG_DONTWAIT, (struct sockaddr *)&to, tolen); if (sent != (ssize_t) msg_size) { - int e = errno; char dst_str[100]; char group_str[100]; pim_inet4_dump("<dst?>", dst_addr, dst_str, sizeof(dst_str)); @@ -1719,7 +1718,7 @@ void pim_igmp_send_membership_query(struct igmp_group *group, zlog_warn("%s: sendto() failure to %s on %s: group=%s msg_size=%zd: errno=%d: %s", __PRETTY_FUNCTION__, dst_str, ifname, group_str, msg_size, - e, safe_strerror(e)); + errno, safe_strerror(errno)); } else { zlog_warn("%s: sendto() partial to %s on %s: group=%s msg_size=%zd: sent=%zd", diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 56f49d62f..41672b1b1 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -50,20 +50,12 @@ static int pim_mroute_set(int fd, int enable) err = setsockopt(fd, IPPROTO_IP, opt, &opt, opt_len); if (err) { - int e = errno; zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,%s=%d): errno=%d: %s", __FILE__, __PRETTY_FUNCTION__, - fd, enable ? "MRT_INIT" : "MRT_DONE", opt, e, safe_strerror(e)); - errno = e; + fd, enable ? "MRT_INIT" : "MRT_DONE", opt, errno, safe_strerror(errno)); return -1; } -#if 0 - zlog_info("%s %s: setsockopt(fd=%d,IPPROTO_IP,MRT_INIT,opt=%d): ok", - __FILE__, __PRETTY_FUNCTION__, - fd, opt); -#endif - return 0; } @@ -452,8 +444,6 @@ int pim_mroute_socket_enable() qpim_mroute_socket_creation = pim_time_monotonic_sec(); mroute_read_on(); - zassert(PIM_MROUTE_IS_ENABLED); - return 0; } @@ -477,8 +467,6 @@ int pim_mroute_socket_disable() mroute_read_off(); qpim_mroute_socket_fd = -1; - zassert(PIM_MROUTE_IS_DISABLED); - return 0; } @@ -524,15 +512,13 @@ int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr, unsigned ch err = setsockopt(qpim_mroute_socket_fd, IPPROTO_IP, MRT_ADD_VIF, (void*) &vc, sizeof(vc)); if (err) { char ifaddr_str[100]; - int e = errno; pim_inet4_dump("<ifaddr?>", ifaddr, ifaddr_str, sizeof(ifaddr_str)); zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_VIF,vif_index=%d,ifaddr=%s,flag=%d): errno=%d: %s", __FILE__, __PRETTY_FUNCTION__, qpim_mroute_socket_fd, ifp->ifindex, ifaddr_str, flags, - e, safe_strerror(e)); - errno = e; + errno, safe_strerror(errno)); return -2; } @@ -555,12 +541,10 @@ int pim_mroute_del_vif(int vif_index) err = setsockopt(qpim_mroute_socket_fd, IPPROTO_IP, MRT_DEL_VIF, (void*) &vc, sizeof(vc)); if (err) { - int e = errno; zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_DEL_VIF,vif_index=%d): errno=%d: %s", __FILE__, __PRETTY_FUNCTION__, qpim_mroute_socket_fd, vif_index, - e, safe_strerror(e)); - errno = e; + errno, safe_strerror(errno)); return -2; } @@ -598,12 +582,10 @@ int pim_mroute_add(struct channel_oil *c_oil) c_oil->oil.mfcc_ttls[c_oil->oil.mfcc_parent] = orig; if (err) { - int e = errno; zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_MFC): errno=%d: %s", __FILE__, __PRETTY_FUNCTION__, qpim_mroute_socket_fd, - e, safe_strerror(e)); - errno = e; + errno, safe_strerror(errno)); return -2; } @@ -626,12 +608,10 @@ int pim_mroute_del (struct channel_oil *c_oil) err = setsockopt(qpim_mroute_socket_fd, IPPROTO_IP, MRT_DEL_MFC, &c_oil->oil, sizeof(c_oil->oil)); if (err) { - int e = errno; zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_DEL_MFC): errno=%d: %s", __FILE__, __PRETTY_FUNCTION__, qpim_mroute_socket_fd, - e, safe_strerror(e)); - errno = e; + errno, safe_strerror(errno)); return -2; } diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index 0dfd39cd1..c1b9e04e2 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -495,14 +495,13 @@ int pim_msg_send(int fd, sent = sendto(fd, pim_msg, pim_msg_size, MSG_DONTWAIT, (struct sockaddr *)&to, tolen); if (sent != (ssize_t) pim_msg_size) { - int e = errno; char dst_str[100]; pim_inet4_dump("<dst?>", dst, dst_str, sizeof(dst_str)); if (sent < 0) { zlog_warn("%s: sendto() failure to %s on %s: fd=%d msg_size=%d: errno=%d: %s", __PRETTY_FUNCTION__, dst_str, ifname, fd, pim_msg_size, - e, safe_strerror(e)); + errno, safe_strerror(errno)); } else { zlog_warn("%s: sendto() partial to %s on %s: fd=%d msg_size=%d: sent=%zd", diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index 231efd0f2..3eeda040b 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -267,7 +267,6 @@ int pim_socket_join_source(int fd, ifindex_t ifindex, const char *ifname) { if (pim_igmp_join_source(fd, ifindex, group_addr, source_addr)) { - int e = errno; char group_str[100]; char source_str[100]; pim_inet4_dump("<grp?>", group_addr, group_str, sizeof(group_str)); @@ -275,7 +274,7 @@ int pim_socket_join_source(int fd, ifindex_t ifindex, zlog_warn("%s: setsockopt(fd=%d) failure for IGMP group %s source %s ifindex %d on interface %s: errno=%d: %s", __PRETTY_FUNCTION__, fd, group_str, source_str, ifindex, ifname, - e, safe_strerror(e)); + errno, safe_strerror(errno)); return -1; } diff --git a/pimd/pim_ssmpingd.c b/pimd/pim_ssmpingd.c index fba563a6f..3f494d112 100644 --- a/pimd/pim_ssmpingd.c +++ b/pimd/pim_ssmpingd.c @@ -197,12 +197,11 @@ static void ssmpingd_delete(struct ssmpingd_sock *ss) THREAD_OFF(ss->t_sock_read); if (close(ss->sock_fd)) { - int e = errno; char source_str[100]; pim_inet4_dump("<src?>", ss->source_addr, source_str, sizeof(source_str)); zlog_warn("%s: failure closing ssmpingd sock_fd=%d for source %s: errno=%d: %s", __PRETTY_FUNCTION__, - ss->sock_fd, source_str, e, safe_strerror(e)); + ss->sock_fd, source_str, errno, safe_strerror(errno)); /* warning only */ } @@ -221,14 +220,13 @@ static void ssmpingd_sendto(struct ssmpingd_sock *ss, sent = sendto(ss->sock_fd, buf, len, MSG_DONTWAIT, (struct sockaddr *)&to, tolen); if (sent != len) { - int e = errno; char to_str[100]; pim_inet4_dump("<to?>", to.sin_addr, to_str, sizeof(to_str)); if (sent < 0) { zlog_warn("%s: sendto() failure to %s,%d: fd=%d len=%d: errno=%d: %s", __PRETTY_FUNCTION__, to_str, ntohs(to.sin_port), ss->sock_fd, len, - e, safe_strerror(e)); + errno, safe_strerror(errno)); } else { zlog_warn("%s: sendto() partial to %s,%d: fd=%d len=%d: sent=%d", diff --git a/pimd/pim_str.c b/pimd/pim_str.c index 3a8353cd8..ee9c74fa3 100644 --- a/pimd/pim_str.c +++ b/pimd/pim_str.c @@ -35,9 +35,8 @@ void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_ int save_errno = errno; if (!inet_ntop(AF_INET, &addr, buf, buf_size)) { - int e = errno; zlog_warn("pim_inet4_dump: inet_ntop(AF_INET,buf_size=%d): errno=%d: %s", - buf_size, e, safe_strerror(e)); + buf_size, errno, safe_strerror(errno)); if (onfail) snprintf(buf, buf_size, "%s", onfail); } |