diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-04-12 14:10:36 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-04-12 14:10:36 +0200 |
commit | 0b8f3d5463807ae4c0a0f880b441775a51737fe8 (patch) | |
tree | b53cf11726bf73566762380f388e45c8abaa0a2f /plugins | |
parent | c64203c7f2c886712c33c21de7e0e53b7939a883 (diff) | |
parent | e4d87aac957ea639935f56fb8b03f3c03d037491 (diff) | |
download | rsyslog-0b8f3d5463807ae4c0a0f880b441775a51737fe8.tar.gz rsyslog-0b8f3d5463807ae4c0a0f880b441775a51737fe8.tar.xz rsyslog-0b8f3d5463807ae4c0a0f880b441775a51737fe8.zip |
Merge branch 'v5-stable-newstats' into v5-devel
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/imuxsock/imuxsock.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 7b122c50..ea54e79b 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -289,16 +289,16 @@ addLstnSocketName(void __attribute__((unused)) *pVal, uchar *pNewVal) } else { listeners[nfd].bParseHost = 0; } - CHKiRet(prop.Construct(&(listeners[nfd].hostName))); if(pLogHostName == NULL) { - CHKiRet(prop.SetString(listeners[nfd].hostName, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName()))); + listeners[nfd].hostName = NULL; } else { + CHKiRet(prop.Construct(&(listeners[nfd].hostName))); CHKiRet(prop.SetString(listeners[nfd].hostName, pLogHostName, ustrlen(pLogHostName))); + CHKiRet(prop.ConstructFinalize(listeners[nfd].hostName)); /* reset hostname for next socket */ free(pLogHostName); pLogHostName = NULL; } - CHKiRet(prop.ConstructFinalize(listeners[nfd].hostName)); if(ratelimitInterval > 0) { if((listeners[nfd].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, NULL)) == NULL) { /* in this case, we simply turn of rate-limiting */ @@ -778,7 +778,7 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred, struct tim pMsg->msgFlags = pLstn->flags; } - MsgSetRcvFrom(pMsg, pLstn->hostName); + MsgSetRcvFrom(pMsg, pLstn->hostName == NULL ? glbl.GetLocalHostNameProp() : pLstn->hostName); CHKiRet(MsgSetRcvFromIP(pMsg, pLocalHostIP)); CHKiRet(submitMsg(pMsg)); @@ -1051,7 +1051,6 @@ CODESTARTafterRun if(pInputName != NULL) prop.Destruct(&pInputName); - ENDafterRun @@ -1147,9 +1146,9 @@ CODEmodInit_QueryRegCFSLineHdlr } /* now init listen socket zero, the local log socket */ - CHKiRet(prop.Construct(&(listeners[0].hostName))); - CHKiRet(prop.SetString(listeners[0].hostName, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName()))); - CHKiRet(prop.ConstructFinalize(listeners[0].hostName)); + CHKiRet(prop.Construct(&pLocalHostIP)); + CHKiRet(prop.SetString(pLocalHostIP, UCHAR_CONSTANT("127.0.0.1"), sizeof("127.0.0.1") - 1)); + CHKiRet(prop.ConstructFinalize(pLocalHostIP)); /* register config file handlers */ CHKiRet(omsdRegCFSLineHdlr((uchar *)"omitlocallogging", 0, eCmdHdlrBinary, |