1 diff -ur sysklogd-1.4.1.orig/sysklogd.8 sysklogd-1.4.1/sysklogd.8
2 --- sysklogd-1.4.1.orig/sysklogd.8 Sun Mar 11 22:35:51 2001
3 +++ sysklogd-1.4.1/sysklogd.8 Mon Oct 8 07:20:31 2001
5 .\" May be distributed under the GNU General Public License
6 .\" Sun Aug 30 11:35:55 MET: Martin Schulze: Updates
8 -.TH SYSKLOGD 8 "12 October 1998" "Version 1.3" "Linux System Administration"
9 +.TH SYSKLOGD 8 "8 October, 2001" "Version 1.4.1+CAEN/OW" "Linux System Administration"
11 sysklogd \- Linux system logging utilities.
24 Specifying this switch on the command line will cause the log daemon to
25 forward any remote messages it receives to forwarding hosts which have been
28 +.BI "\-i " "IP address"
31 +is configured to accept log input from a UDP port, specify an IP address
32 +to bind to, rather than the default of INADDR_ANY. The address must be in
33 +dotted quad notation, DNS host names are not allowed.
36 Specify a hostname that should be logged only with its simple hostname
37 diff -ur sysklogd-1.4.1.orig/syslogd.c sysklogd-1.4.1/syslogd.c
38 --- sysklogd-1.4.1.orig/syslogd.c Sun Mar 11 22:40:10 2001
39 +++ sysklogd-1.4.1/syslogd.c Mon Oct 8 07:24:41 2001
41 int NoHops = 1; /* Can we bounce syslog messages through an
44 +char *bind_addr = NULL; /* bind UDP port to this interface only */
48 /* Function prototypes. */
53 - while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)
54 + while ((ch = getopt(argc, argv, "a:dhf:i:l:m:np:rs:v")) != EOF)
57 if (nfunix < MAXFUNIX)
64 + fprintf(stderr, "Only one -i argument allowed, "
65 + "the first one is taken.\n");
72 - fprintf (stderr, "Only one -l argument allowed," \
73 + fprintf(stderr, "Only one -l argument allowed, "
74 "the first one is taken.\n");
80 fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
81 - " [-s domainlist] [-f conffile]\n");
82 + " [-s domainlist] [-f conffile] [-i IP address]\n");
86 @@ -1217,15 +1227,22 @@
88 struct sockaddr_in sin;
90 + memset(&sin, 0, sizeof(sin));
91 + sin.sin_family = AF_INET;
92 + sin.sin_port = LogPort;
94 + if (!inet_aton(bind_addr, &sin.sin_addr)) {
95 + logerror("syslog: not a valid IP address to bind to.");
100 fd = socket(AF_INET, SOCK_DGRAM, 0);
102 logerror("syslog: Unknown protocol, suspending inet service.");
106 - memset(&sin, 0, sizeof(sin));
107 - sin.sin_family = AF_INET;
108 - sin.sin_port = LogPort;
109 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, \
110 (char *) &on, sizeof(on)) < 0 ) {
111 logerror("setsockopt(REUSEADDR), suspending inet");