1 --- sysklogd-1.5/sysklogd.8.orig 2007-05-27 14:16:17.000000000 +0200
2 +++ sysklogd-1.5/sysklogd.8 2007-09-03 23:39:50.712669654 +0200
14 This can cause syslog loops that fill up hard disks quite fast and
15 thus needs to be used with caution.
17 +.BI "\-i " "IP address"
20 +is configured to accept log input from a UDP port, specify an IP address
21 +to bind to, rather than the default of INADDR_ANY. The address must be in
22 +dotted quad notation, DNS host names are not allowed.
25 Specify a hostname that should be logged only with its simple hostname
26 and not the fqdn. Multiple hosts may be specified using the colon
27 diff -ur sysklogd-1.4.1.orig/syslogd.c sysklogd-1.4.1/syslogd.c
28 --- sysklogd-1.4.1.orig/syslogd.c Sun Mar 11 22:40:10 2001
29 +++ sysklogd-1.4.1/syslogd.c Mon Oct 8 07:24:41 2001
31 int NoHops = 1; /* Can we bounce syslog messages through an
34 +char *bind_addr = NULL; /* bind UDP port to this interface only */
38 /* Function prototypes. */
43 - while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)
44 + while ((ch = getopt(argc, argv, "a:dhf:i:l:m:np:rs:v")) != EOF)
47 if (nfunix < MAXFUNIX)
54 + fprintf(stderr, "Only one -i argument allowed, "
55 + "the first one is taken.\n");
62 - fprintf (stderr, "Only one -l argument allowed," \
63 + fprintf(stderr, "Only one -l argument allowed, "
64 "the first one is taken.\n");
70 fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
71 - " [-s domainlist] [-f conffile]\n");
72 + " [-s domainlist] [-f conffile] [-i IP address]\n");
76 @@ -1217,15 +1227,22 @@
78 struct sockaddr_in sin;
80 + memset(&sin, 0, sizeof(sin));
81 + sin.sin_family = AF_INET;
82 + sin.sin_port = LogPort;
84 + if (!inet_aton(bind_addr, &sin.sin_addr)) {
85 + logerror("syslog: not a valid IP address to bind to.");
90 fd = socket(AF_INET, SOCK_DGRAM, 0);
92 logerror("syslog: Unknown protocol, suspending inet service.");
96 - memset(&sin, 0, sizeof(sin));
97 - sin.sin_family = AF_INET;
98 - sin.sin_port = LogPort;
99 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, \
100 (char *) &on, sizeof(on)) < 0 ) {
101 logerror("setsockopt(REUSEADDR), suspending inet");