summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-03-21 11:43:45 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-03-21 11:43:45 +0100
commit49ec54d36984b9e91da7bd41e56e65dac22ce830 (patch)
tree09bcb0b68f6ec337bc938e53d95840b75955ebbc /tools/syslogd.c
parentdbc2efa6bea0a0ca7ded6d4a5f0378da0aab6936 (diff)
downloadrsyslog-49ec54d36984b9e91da7bd41e56e65dac22ce830.tar.gz
rsyslog-49ec54d36984b9e91da7bd41e56e65dac22ce830.tar.xz
rsyslog-49ec54d36984b9e91da7bd41e56e65dac22ce830.zip
milestone: added capability to use a local interface IP address as fromhost-ip
... for locally originating messages. New directive $LocalHostIPIF. Note that not all modules yet support this new directive - next step...
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 02a0dad6..9cd3c9ca 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -199,7 +199,6 @@ static rsRetVal GlobalClassExit(void);
#endif
static prop_t *pInternalInputName = NULL; /* there is only one global inputName for all internally-generated messages */
-static prop_t *pLocalHostIP = NULL; /* there is only one global IP for all internally-generated messages */
static uchar *ConfFile = (uchar*) _PATH_LOGCONF; /* read-only after startup */
static char *PidFile = _PATH_LOGPID; /* read-only after startup */
@@ -545,7 +544,8 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags)
MsgSetRawMsgWOSize(pMsg, (char*)msg);
MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName()));
MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp());
- MsgSetRcvFromIP(pMsg, pLocalHostIP);
+dbgprintf("ZZZZ: pLocalHostIPIF used!\n");
+ MsgSetRcvFromIP(pMsg, glbl.GetLocalHostIP());
MsgSetMSGoffs(pMsg, 0);
/* check if we have an error code associated and, if so,
* adjust the tag. -- rgerhards, 2008-06-27
@@ -1109,8 +1109,6 @@ die(int sig)
/* destruct our global properties */
if(pInternalInputName != NULL)
prop.Destruct(&pInternalInputName);
- if(pLocalHostIP != NULL)
- prop.Destruct(&pLocalHostIP);
/* terminate the remaining classes */
GlobalClassExit();
@@ -2660,10 +2658,6 @@ int realMain(int argc, char **argv)
CHKiRet(prop.SetString(pInternalInputName, UCHAR_CONSTANT("rsyslogd"), sizeof("rsyslgod") - 1));
CHKiRet(prop.ConstructFinalize(pInternalInputName));
- CHKiRet(prop.Construct(&pLocalHostIP));
- CHKiRet(prop.SetString(pLocalHostIP, UCHAR_CONSTANT("127.0.0.1"), sizeof("127.0.0.1") - 1));
- CHKiRet(prop.ConstructFinalize(pLocalHostIP));
-
/* get our host and domain names - we need to do this early as we may emit
* error log messages, which need the correct hostname. -- rgerhards, 2008-04-04
*/
@@ -2712,7 +2706,6 @@ int realMain(int argc, char **argv)
CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_aliases[i]));
} else {
CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_name));
- int i;
}
if((p = (uchar*)strchr((char*)LocalHostName, '.')))