Changeset 341 for trunk/src/sh_forward.c
- Timestamp:
- May 11, 2011, 9:34:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_forward.c
r315 r341 5774 5774 * should be no problem as long as sizeof(struct sockaddr_in) < INT_MAX ... 5775 5775 */ 5776 intfromlen = sizeof(from);5776 unsigned int fromlen = sizeof(from); 5777 5777 5778 5778 if (enable_syslog_socket == S_FALSE) … … 5791 5791 res = recvfrom(fd, buf, 1047, 0, (struct sockaddr *) &from, &fromlen); 5792 5792 5793 sh_ipvx_save(&ss, sa->sa_family, &from);5793 sh_ipvx_save(&ss, sa->sa_family, (struct sockaddr *) &from); 5794 5794 sh_ipvx_ntoa(namebuf, sizeof(namebuf), &ss); 5795 5795 … … 5855 5855 tmp = sh_tools_safe_name (ptr, 1); 5856 5856 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_INET_SYSLOG, 5857 my_inet_ntoa(from.sin_addr),5857 namebuf, 5858 5858 (cfac == NULL) ? _("none") : cfac, 5859 5859 (cpri == NULL) ? _("none") : cpri, … … 5959 5959 if (callerFlag == S_FALSE) 5960 5960 { 5961 if (enable_syslog_socket == S_FALSE && syslog_sock >=0)5961 if (enable_syslog_socket == S_FALSE && syslog_sock_n > 0) 5962 5962 { 5963 5963 /* user does not wish to use this facility 5964 5964 */ 5965 5965 TPT(( 0, FIL__, __LINE__, _("msg=<close syslog socket>\n"))); 5966 sl_close_fd(FIL__, __LINE__, syslog_sock); 5967 syslog_sock[0] = -1; 5966 for (sock = 0; sock < syslog_sock_n; ++sock) 5967 { 5968 sl_close_fd(FIL__, __LINE__, syslog_sock[sock]); 5969 syslog_sock[0] = -1; 5970 } 5968 5971 } 5969 5972 SL_RETURN((-1), _("create_syslog_socket")); … … 5978 5981 addr.sin_port = htons(514); 5979 5982 5980 do_syslog_socket(AF_INET, SOCK_DGRAM, 0, (struct sockaddr *) &addr, addrlen); 5983 sock = do_syslog_socket(AF_INET, SOCK_DGRAM, 0, 5984 (struct sockaddr *) &addr, addrlen); 5981 5985 5982 5986 if (sock >= 0) { … … 5991 5995 if (getaddrinfo (NULL, "syslog", &hints, &ai) != 0) 5992 5996 { 5993 errnum = errno;5997 int errnum = errno; 5994 5998 sh_forward_printerr (_("getaddrinfo"), errnum, 514, __LINE__); 5995 sl_close_fd (FIL__, __LINE__, sock);5996 5999 SL_RETURN((-1), _("create_syslog_socket")); 5997 6000 } … … 6019 6022 } 6020 6023 freeaddrinfo (ai); 6021 #endif6022 6024 6023 6025 end: 6026 #endif 6024 6027 if (syslog_sock_n > 1) 6025 6028 SH_MINSOCK += (syslog_sock_n - 1);
Note:
See TracChangeset
for help on using the changeset viewer.