summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-17 09:25:03 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-17 09:25:03 +0200
commit8c65706d22cb62d724a030b5f0a9603751daac2d (patch)
tree0424fa57791d76ecb5b05dae337381ccec407124 /tools
parent87c936ab65b4381fed35689b38c98f130883d903 (diff)
downloadrsyslog-8c65706d22cb62d724a030b5f0a9603751daac2d.tar.gz
rsyslog-8c65706d22cb62d724a030b5f0a9603751daac2d.tar.xz
rsyslog-8c65706d22cb62d724a030b5f0a9603751daac2d.zip
moved "family" variable to global data pool
Diffstat (limited to 'tools')
-rw-r--r--tools/omfwd.c8
-rw-r--r--tools/syslogd.c5
2 files changed, 8 insertions, 5 deletions
diff --git a/tools/omfwd.c b/tools/omfwd.c
index ddaf496d..80f62c8a 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -58,6 +58,7 @@
#include "tcpclt.h"
#include "cfsysline.h"
#include "module-template.h"
+#include "glbl.h"
#include "errmsg.h"
MODULE_TYPE_OUTPUT
@@ -66,6 +67,7 @@ MODULE_TYPE_OUTPUT
*/
DEF_OMOD_STATIC_DATA
DEFobjCurrIf(errmsg)
+DEFobjCurrIf(glbl)
DEFobjCurrIf(net)
DEFobjCurrIf(tcpclt)
@@ -303,7 +305,7 @@ static rsRetVal doTryResume(instanceData *pData)
* a common function.
*/
hints.ai_flags = AI_NUMERICSERV;
- hints.ai_family = family;
+ hints.ai_family = glbl.GetDefPFFamily();
hints.ai_socktype = pData->protocol == FORW_UDP ? SOCK_DGRAM : SOCK_STREAM;
if((e = getaddrinfo(pData->f_hname,
getFwdSyslogPt(pData), &hints, &res)) == 0) {
@@ -556,7 +558,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
memset(&hints, 0, sizeof(hints));
/* port must be numeric, because config file syntax requests this */
hints.ai_flags = AI_NUMERICSERV;
- hints.ai_family = family;
+ hints.ai_family = glbl.GetDefPFFamily();
hints.ai_socktype = pData->protocol == FORW_UDP ? SOCK_DGRAM : SOCK_STREAM;
if( (error = getaddrinfo(pData->f_hname, getFwdSyslogPt(pData), &hints, &res)) != 0) {
pData->eDestState = eDestFORW_UNKN;
@@ -596,6 +598,7 @@ BEGINmodExit
CODESTARTmodExit
/* release what we no longer need */
objRelease(errmsg, CORE_COMPONENT);
+ objRelease(glbl, CORE_COMPONENT);
objRelease(net, LM_NET_FILENAME);
objRelease(tcpclt, LM_TCPCLT_FILENAME);
@@ -630,6 +633,7 @@ BEGINmodInit(Fwd)
CODESTARTmodInit
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
CODEmodInit_QueryRegCFSLineHdlr
+ CHKiRet(objUse(glbl, CORE_COMPONENT));
CHKiRet(objUse(errmsg, CORE_COMPONENT));
CHKiRet(objUse(net, LM_NET_FILENAME));
CHKiRet(objUse(tcpclt, LM_TCPCLT_FILENAME));
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 4fe0071a..90beba24 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -295,7 +295,6 @@ uchar *glblModPath = NULL; /* module load path - only used during initial init,
uchar *LocalHostName = NULL;/* our hostname - read-only after startup */
char *LocalDomain; /* our local domain name - read-only after startup */
int MarkInterval = 20 * 60; /* interval between marks in seconds - read-only after startup */
-//int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both), set via cmdline */
int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */
static int NoFork = 0; /* don't fork - don't run in daemon mode - read-only after startup */
int DisableDNS = 0; /* don't look up IP addresses of remote messages */
@@ -3127,10 +3126,10 @@ int realMain(int argc, char **argv)
dbgprintf("deque option %c, optarg '%s'\n", ch, arg);
switch((char)ch) {
case '4':
- family = PF_INET;
+ glbl.SetDefPFFamily(PF_INET);
break;
case '6':
- family = PF_INET6;
+ glbl.SetDefPFFamily(PF_INET6);
break;
case 'A':
send_to_all++;