diff options
author | Axel Rau <axel.rau@chaos1.de> | 2013-05-01 18:45:31 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-05-06 17:42:17 +0200 |
commit | 7369904b578322f7fb22897def3cd63b27eacf46 (patch) | |
tree | 269eba24aa24f0a9139ea166648709355fcf2757 /tools/syslogd.c | |
parent | 40254dcc8cf3d9ab17f30f417a95709cbf9204bf (diff) | |
download | rsyslog-7369904b578322f7fb22897def3cd63b27eacf46.tar.gz rsyslog-7369904b578322f7fb22897def3cd63b27eacf46.tar.bz2 rsyslog-7369904b578322f7fb22897def3cd63b27eacf46.zip |
Add configurable local client IP
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r-- | tools/syslogd.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index 1b38bf92..47a21585 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1773,7 +1773,7 @@ int realMain(int argc, char **argv) * of other options, we do this during the inital option processing. * rgerhards, 2008-04-04 */ - while((ch = getopt(argc, argv, "46a:Ac:dDef:g:hi:l:m:M:nN:op:qQr::s:t:T:u:vwx")) != EOF) { + while((ch = getopt(argc, argv, "46a:Ac:dDef:g:hi:l:m:M:nN:op:qQr::s:S:t:T:u:vwx")) != EOF) { switch((char)ch) { case '4': case '6': @@ -1791,6 +1791,7 @@ int realMain(int argc, char **argv) case 'q': /* add hostname if DNS resolving has failed */ case 'Q': /* dont resolve hostnames in ACL to IPs */ case 's': + case 'S': /* Source IP for local client to be used on multihomed host */ case 'T': /* chroot on startup (primarily for testing) */ case 'u': /* misc user settings */ case 'w': /* disable disallowed host warnings */ @@ -1882,6 +1883,13 @@ int realMain(int argc, char **argv) case 'a': fprintf(stderr, "rsyslogd: error -a is no longer supported, use module imuxsock instead"); break; + case 'S': /* Source IP for local client to be used on multihomed host */ + if(glbl.GetSourceIPofLocalClient() != NULL) { + fprintf (stderr, "rsyslogd: Only one -S argument allowed, the first one is taken.\n"); + } else { + glbl.SetSourceIPofLocalClient(arg); + } + break; case 'f': /* configuration file */ ConfFile = (uchar*) arg; break; |