summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-07-14 14:46:47 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-07-14 14:46:47 +0200
commit40a4ddac7a0fc2ff2dcfd584976ea7ce8bdcfc7b (patch)
tree8e8d1ecfbf7de4d3fae4eead50c08e6ef0d9b6fa
parenta6de2e589254dbfffd2746d8efbefc04f8ed3725 (diff)
downloadrsyslog-40a4ddac7a0fc2ff2dcfd584976ea7ce8bdcfc7b.tar.gz
rsyslog-40a4ddac7a0fc2ff2dcfd584976ea7ce8bdcfc7b.tar.xz
rsyslog-40a4ddac7a0fc2ff2dcfd584976ea7ce8bdcfc7b.zip
bugfix: UDP syslog forwarding did not work on all platforms
the ai_socktype was incorrectly set to 1. On some platforms, this lead to failing name resolution (e.g. FreeBSD 7). Thanks to HKS for reporting the bug.
-rw-r--r--ChangeLog4
-rw-r--r--tools/omfwd.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e3e3cb5..66cc1e5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
---------------------------------------------------------------------------
Version 3.19.10 (rgerhards), 2008-07-??
- bugfix: bad memory leak in disk-based queue modes
+- bugfix: UDP syslog forwarding did not work on all platforms
+ the ai_socktype was incorrectly set to 1. On some platforms, this
+ lead to failing name resolution (e.g. FreeBSD 7). Thanks to HKS for
+ reporting the bug.
- important queue bugfix from 3.18.1 imported (see below)
- cleanup of some debug messages
---------------------------------------------------------------------------
diff --git a/tools/omfwd.c b/tools/omfwd.c
index 715457c9..30761a87 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -334,9 +334,10 @@ finalize_it:
*/
static rsRetVal doTryResume(instanceData *pData)
{
- DEFiRet;
+ int iErr;
struct addrinfo *res;
struct addrinfo hints;
+ DEFiRet;
if(pData->bIsConnected)
FINALIZE;
@@ -348,8 +349,10 @@ static rsRetVal doTryResume(instanceData *pData)
/* port must be numeric, because config file syntax requires this */
hints.ai_flags = AI_NUMERICSERV;
hints.ai_family = glbl.GetDefPFFamily();
- hints.ai_socktype = pData->protocol == SOCK_DGRAM;
- if((getaddrinfo(pData->f_hname, getFwdPt(pData), &hints, &res)) != 0) {
+ hints.ai_socktype = SOCK_DGRAM;
+ if((iErr = (getaddrinfo(pData->f_hname, getFwdPt(pData), &hints, &res))) != 0) {
+ dbgprintf("could not get addrinfo for hostname '%s':'%s': %d%s\n",
+ pData->f_hname, getFwdPt(pData), iErr, gai_strerror(iErr));
ABORT_FINALIZE(RS_RET_SUSPENDED);
}
dbgprintf("%s found, resuming.\n", pData->f_hname);