mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-18 00:30:41 +01:00
deprecate -4,-6 command line options
and introduce the global(net.ipprotocol) parameter as an alternative
This commit is contained in:
parent
0f6e03b86d
commit
ffac82e806
@ -143,6 +143,7 @@ static struct cnfparamdescr cnfparamdescr[] = {
|
||||
{ "parser.escapecontrolcharacterscstyle", eCmdHdlrBinary, 0 },
|
||||
{ "stdlog.channelspec", eCmdHdlrString, 0 },
|
||||
{ "janitor.interval", eCmdHdlrPositiveInt, 0 },
|
||||
{ "net.ipprotocol", eCmdHdlrGetWord, 0 },
|
||||
{ "processinternalmessages", eCmdHdlrBinary, 0 }
|
||||
};
|
||||
static struct cnfparamblk paramblk =
|
||||
@ -191,7 +192,6 @@ SIMP_PROP(OptimizeUniProc, bOptimizeUniProc, int)
|
||||
SIMP_PROP(PreserveFQDN, bPreserveFQDN, int)
|
||||
SIMP_PROP(mainqCnfObj, mainqCnfObj, struct cnfobj *)
|
||||
SIMP_PROP(MaxLine, iMaxLine, int)
|
||||
SIMP_PROP(DefPFFamily, iDefPFFamily, int) /* note that in the future we may check the family argument */
|
||||
SIMP_PROP(DropMalPTRMsgs, bDropMalPTRMsgs, int)
|
||||
SIMP_PROP(Option_DisallowWarning, option_DisallowWarning, int)
|
||||
SIMP_PROP(DisableDNS, bDisableDNS, int)
|
||||
@ -350,7 +350,6 @@ setDebugFile(void __attribute__((unused)) *pVal, uchar *pNewVal)
|
||||
RETiRet;
|
||||
}
|
||||
|
||||
|
||||
static rsRetVal
|
||||
setDebugLevel(void __attribute__((unused)) *pVal, int level)
|
||||
{
|
||||
@ -362,6 +361,20 @@ setDebugLevel(void __attribute__((unused)) *pVal, int level)
|
||||
}
|
||||
|
||||
|
||||
static rsRetVal
|
||||
setDefPFFamily(int level)
|
||||
{
|
||||
DEFiRet;
|
||||
iDefPFFamily = level;
|
||||
RETiRet;
|
||||
}
|
||||
|
||||
static int
|
||||
getDefPFFamily(void)
|
||||
{
|
||||
return iDefPFFamily;
|
||||
}
|
||||
|
||||
/* return our local IP.
|
||||
* If no local IP is set, "127.0.0.1" is selected *and* set. This
|
||||
* is an intensional side effect that we do in order to keep things
|
||||
@ -612,6 +625,8 @@ CODESTARTobjQueryInterface(glbl)
|
||||
pIf->GetGlobalInputTermState = GetGlobalInputTermState;
|
||||
pIf->GetSourceIPofLocalClient = GetSourceIPofLocalClient; /* [ar] */
|
||||
pIf->SetSourceIPofLocalClient = SetSourceIPofLocalClient; /* [ar] */
|
||||
pIf->SetDefPFFamily = setDefPFFamily;
|
||||
pIf->GetDefPFFamily = getDefPFFamily;
|
||||
#define SIMP_PROP(name) \
|
||||
pIf->Get##name = Get##name; \
|
||||
pIf->Set##name = Set##name;
|
||||
@ -619,7 +634,6 @@ CODESTARTobjQueryInterface(glbl)
|
||||
SIMP_PROP(OptimizeUniProc);
|
||||
SIMP_PROP(ParseHOSTNAMEandTAG);
|
||||
SIMP_PROP(PreserveFQDN);
|
||||
SIMP_PROP(DefPFFamily);
|
||||
SIMP_PROP(DropMalPTRMsgs);
|
||||
SIMP_PROP(Option_DisallowWarning);
|
||||
SIMP_PROP(DisableDNS);
|
||||
@ -957,6 +971,19 @@ glblDoneLoadCnf(void)
|
||||
errmsg.LogError(0, RS_RET_OK, "debug log file is '%s', fd %d", pszAltDbgFileName, altdbg);
|
||||
} else if(!strcmp(paramblk.descr[i].name, "janitor.interval")) {
|
||||
janitorInterval = (int) cnfparamvals[i].val.d.n;
|
||||
} else if(!strcmp(paramblk.descr[i].name, "net.ipprotocol")) {
|
||||
char *proto = es_str2cstr(cnfparamvals[i].val.d.estr, NULL);
|
||||
if(!strcmp(proto, "unspecified")) {
|
||||
iDefPFFamily = PF_UNSPEC;
|
||||
} else if(!strcmp(proto, "ipv4-only")) {
|
||||
iDefPFFamily = PF_INET;
|
||||
} else if(!strcmp(proto, "ipv6-only")) {
|
||||
iDefPFFamily = PF_INET6;
|
||||
} else{
|
||||
errmsg.LogError(0, RS_RET_ERR, "invalid net.ipprotocol "
|
||||
"parameter '%s' -- ignored", proto);
|
||||
}
|
||||
free(proto);
|
||||
} else {
|
||||
dbgprintf("glblDoneLoadCnf: program error, non-handled "
|
||||
"param '%s'\n", paramblk.descr[i].name);
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
.\" Copyright 2004-2008 Rainer Gerhards and Adiscon for the rsyslog modifications
|
||||
.\" Copyright 2004-2014 Rainer Gerhards and Adiscon for the rsyslog modifications
|
||||
.\" May be distributed under the GNU General Public License
|
||||
.\"
|
||||
.TH RSYSLOGD 8 "27 May 2014" "Version 8.3.3" "Linux System Administration"
|
||||
.TH RSYSLOGD 8 "02 Dec 2014" "Version 8.6.0" "Linux System Administration"
|
||||
.SH NAME
|
||||
rsyslogd \- reliable and extended syslogd
|
||||
.SH SYNOPSIS
|
||||
.B rsyslogd
|
||||
.RB [ " \-4 " ]
|
||||
.RB [ " \-6 " ]
|
||||
.RB [ " \-A " ]
|
||||
.RB [ " \-d " ]
|
||||
.RB [ " \-D " ]
|
||||
@ -104,22 +102,6 @@ is given, messages are sent to all targets. This may improve
|
||||
reliability, but may also cause message duplication. This option
|
||||
should be enabled only if it is fully understood.
|
||||
.TP
|
||||
.BI "\-4"
|
||||
Causes
|
||||
.B rsyslogd
|
||||
to listen to IPv4 addresses only.
|
||||
If neither -4 nor -6 is given,
|
||||
.B rsyslogd
|
||||
listens to all configured addresses of the system.
|
||||
.TP
|
||||
.BI "\-6"
|
||||
Causes
|
||||
.B rsyslogd
|
||||
to listen to IPv6 addresses only.
|
||||
If neither -4 nor -6 is given,
|
||||
.B rsyslogd
|
||||
listens to all configured addresses of the system.
|
||||
.TP
|
||||
.BI "\-c " "version"
|
||||
This option has been obsoleted and has no function any longer. It is still
|
||||
accepted in order not to break existing scripts. However, future versions
|
||||
|
||||
@ -1105,9 +1105,15 @@ initAll(int argc, char **argv)
|
||||
DBGPRINTF("deque option %c, optarg '%s'\n", ch, (arg == NULL) ? "" : arg);
|
||||
switch((char)ch) {
|
||||
case '4':
|
||||
fprintf (stderr, "rsyslogd: the -4 command line option will go away "
|
||||
"soon.\nPlease use the global(net.ipproto=\"ipv4-only\") "
|
||||
"configuration parameter instead.\n");
|
||||
glbl.SetDefPFFamily(PF_INET);
|
||||
break;
|
||||
case '6':
|
||||
fprintf (stderr, "rsyslogd: the -4 command line option will go away "
|
||||
"soon.\nPlease use the global(net.ipproto=\"ipv6-only\") "
|
||||
"configuration parameter instead.\n");
|
||||
glbl.SetDefPFFamily(PF_INET6);
|
||||
break;
|
||||
case 'A':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user