deprecate -S command line parameter and add replacement

This commit is contained in:
Rainer Gerhards 2014-11-27 14:15:25 +01:00
parent 7902f04ea7
commit c518b55a67
3 changed files with 12 additions and 6 deletions

View File

@ -84,6 +84,7 @@ typedef struct _instanceData {
uchar *myCertFile;
uchar *myPrivKeyFile;
uchar *tplName;
uchar *localClientIP;
struct {
int nmemb;
uchar **name;
@ -121,6 +122,7 @@ static struct cnfparamdescr actpdescr[] = {
{ "rebindinterval", eCmdHdlrInt, 0 },
{ "windowsize", eCmdHdlrInt, 0 },
{ "timeout", eCmdHdlrInt, 0 },
{ "localclientip", eCmdHdlrGetWord, 0 },
{ "template", eCmdHdlrGetWord, 0 }
};
static struct cnfparamblk actpblk =
@ -212,8 +214,8 @@ doCreateRelpClient(wrkrInstanceData_t *pWrkrData)
relpCltAddPermittedPeer(pWrkrData->pRelpClt, (char*)pData->permittedPeers.name[i]);
}
}
if(glbl.GetSourceIPofLocalClient() == NULL) { /* ar Do we have a client IP set? */
if(relpCltSetClientIP(pWrkrData->pRelpClt, glbl.GetSourceIPofLocalClient()) != RELP_RET_OK)
if(pData->localClientIP == NULL) {
if(relpCltSetClientIP(pWrkrData->pRelpClt, pData->localClientIP) != RELP_RET_OK)
ABORT_FINALIZE(RS_RET_RELP_ERR);
}
pWrkrData->bInitialConnect = 1;
@ -232,6 +234,7 @@ CODESTARTcreateInstance
pData->bHadAuthFail = 0;
pData->pristring = NULL;
pData->authmode = NULL;
pData->localClientIP = NULL;
pData->caCertFile = NULL;
pData->myCertFile = NULL;
pData->myPrivKeyFile = NULL;
@ -252,6 +255,7 @@ CODESTARTfreeInstance
free(pData->tplName);
free(pData->pristring);
free(pData->authmode);
free(pData->localClientIP);
free(pData->caCertFile);
free(pData->myCertFile);
free(pData->myPrivKeyFile);
@ -279,6 +283,7 @@ setInstParamDefaults(instanceData *pData)
pData->bEnableTLSZip = DFLT_ENABLE_TLSZIP;
pData->pristring = NULL;
pData->authmode = NULL;
pData->localClientIP = (uchar*)strdup((char*)glbl.GetSourceIPofLocalClient());
pData->caCertFile = NULL;
pData->myCertFile = NULL;
pData->myPrivKeyFile = NULL;
@ -306,6 +311,8 @@ CODESTARTnewActInst
pData->port = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
} else if(!strcmp(actpblk.descr[i].name, "template")) {
pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
} else if(!strcmp(actpblk.descr[i].name, "localclientip")) {
pData->localClientIP = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
} else if(!strcmp(actpblk.descr[i].name, "timeout")) {
pData->timeout = (unsigned) pvals[i].val.d.n;
} else if(!strcmp(actpblk.descr[i].name, "rebindinterval")) {

View File

@ -155,10 +155,6 @@ is specified and the host logging resolves to satu.infodrom.north.de
no domain would be cut, you will have to specify two domains like:
.BR "\-s north.de:infodrom.north.de" .
.TP
.BI "\-S ip_address" "local client source IP"
rsyslogd uses ip_address as local client address while connecting
to remote logserver. Currently used by omrelp only and only with tcp.
.TP
.BI "\-u " "userlevel"
This is a "catch all" option for some very seldomly-used user settings.
The "userlevel" variable selects multiple things. Add the specific values

View File

@ -1123,6 +1123,9 @@ initAll(int argc, char **argv)
send_to_all++;
break;
case 'S': /* Source IP for local client to be used on multihomed host */
fprintf (stderr, "rsyslogd: the -S command line option will go away "
"soon.\n"
"Please use the omrelp paramter \"localClientIP\" instead.\n");
if(glbl.GetSourceIPofLocalClient() != NULL) {
fprintf (stderr, "rsyslogd: Only one -S argument allowed, the first one is taken.\n");
} else {