summaryrefslogtreecommitdiffstats
path: root/plugins/imuxsock
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/imuxsock')
-rw-r--r--plugins/imuxsock/imuxsock.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index 8e6dc7bc..7b122c50 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -161,7 +161,6 @@ static int sd_fds = 0; /* number of systemd activated sockets */
/* config settings */
static int bOmitLocalLogging = 0;
static uchar *pLogSockName = NULL;
-static uchar *pLocalIPIF = NULL;
static uchar *pLogHostName = NULL; /* host name to use with this socket */
static int bUseFlowCtl = 0; /* use flow control or not (if yes, only LIGHT is used! */
static int bIgnoreTimestamp = 1; /* ignore timestamps present in the incoming message? */
@@ -949,8 +948,6 @@ ENDrunInput
BEGINwillRun
- uchar myIP[128];
- rsRetVal localRet;
CODESTARTwillRun
register int i;
int actSocks;
@@ -1015,22 +1012,7 @@ CODESTARTwillRun
CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imuxsock"), sizeof("imuxsock") - 1));
CHKiRet(prop.ConstructFinalize(pInputName));
- if(pLocalIPIF == NULL) {
- strcpy((char*)myIP, "127.0.0.1");
- } else {
- localRet = net.GetIFIPAddr((uchar*)pLocalIPIF, AF_UNSPEC, myIP, (int) sizeof(myIP));
- if(localRet != RS_RET_OK) {
- DBGPRINTF("imuxsock: could not obtain my IP, using 127.0.0.1 instead\n");
- strcpy((char*)myIP, "127.0.0.1");
- }
- }
-
- DBGPRINTF("imuxsock: using '%s' as localhost IP\n", myIP);
-
- CHKiRet(prop.Construct(&pLocalHostIP));
- CHKiRet(prop.SetString(pLocalHostIP, myIP, ustrlen(myIP)));
- CHKiRet(prop.ConstructFinalize(pLocalHostIP));
-
+ pLocalHostIP = glbl.GetLocalHostIP();
finalize_it:
ENDwillRun
@@ -1062,7 +1044,6 @@ CODESTARTafterRun
}
/* free no longer needed string */
free(pLogSockName);
- free(pLocalIPIF);
free(pLogHostName);
discardLogSockets();
@@ -1107,10 +1088,6 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a
free(pLogSockName);
pLogSockName = NULL;
}
- if(pLocalIPIF != NULL) {
- free(pLocalIPIF);
- pLocalIPIF = NULL;
- }
if(pLogHostName != NULL) {
free(pLogHostName);
pLogHostName = NULL;
@@ -1203,8 +1180,6 @@ CODEmodInit_QueryRegCFSLineHdlr
NULL, &ratelimitSeverity, STD_LOADABLE_MODULE_ID));
CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler,
resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID));
- CHKiRet(omsdRegCFSLineHdlr((uchar *)"imuxsocklocalipif", 0, eCmdHdlrGetWord,
- NULL, &pLocalIPIF, STD_LOADABLE_MODULE_ID));
/* the following one is a (dirty) trick: the system log socket is not added via
* an "addUnixListenSocket" config format. As such, it's properties can not be modified
* via $InputUnixListenSocket*". So we need to add a special directive