Simplify, remove #ifdefs for INET6, always defined
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
33411f8a0c
commit
1ba3dc5b87
@ -25,7 +25,7 @@ AM_CFLAGS += -Wno-unused-result -Wno-unused-parameter
|
|||||||
AM_CFLAGS += -fomit-frame-pointer -fno-strength-reduce
|
AM_CFLAGS += -fomit-frame-pointer -fno-strength-reduce
|
||||||
|
|
||||||
syslogd_SOURCES = syslogd.c pidfile.c pidfile.h
|
syslogd_SOURCES = syslogd.c pidfile.c pidfile.h
|
||||||
syslogd_CPPFLAGS = -DINET6 -D_BSD_SOURCE -D_DEFAULT_SOURCE
|
syslogd_CPPFLAGS = -D_BSD_SOURCE -D_DEFAULT_SOURCE
|
||||||
|
|
||||||
klogd_SOURCES = klogd.c klogd.h syslog.c pidfile.c pidfile.h \
|
klogd_SOURCES = klogd.c klogd.h syslog.c pidfile.c pidfile.h \
|
||||||
ksym.c ksyms.h ksym_mod.c module.h
|
ksym.c ksyms.h ksym_mod.c module.h
|
||||||
@ -35,6 +35,6 @@ logger_SOURCES = logger.c syslog.c
|
|||||||
logger_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
logger_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
||||||
|
|
||||||
tsyslogd_SOURCES = syslogd.c pidfile.c pidfile.h
|
tsyslogd_SOURCES = syslogd.c pidfile.c pidfile.h
|
||||||
tsyslogd_CPPFLAGS = -DINET6 -D_BSD_SOURCE -D_DEFAULT_SOURCE -DTESTING
|
tsyslogd_CPPFLAGS = -D_BSD_SOURCE -D_DEFAULT_SOURCE -DTESTING
|
||||||
|
|
||||||
syslog_tst_SOURCES = syslog_tst.c
|
syslog_tst_SOURCES = syslog_tst.c
|
||||||
|
@ -63,7 +63,7 @@ MAN_PERMS = 644
|
|||||||
# ballot below.
|
# ballot below.
|
||||||
SYSLOGD_PIDNAME = -DSYSLOGD_PIDNAME=\"syslogd.pid\"
|
SYSLOGD_PIDNAME = -DSYSLOGD_PIDNAME=\"syslogd.pid\"
|
||||||
|
|
||||||
SYSLOGD_FLAGS= -DINET6 ${SYSLOGD_PIDNAME}
|
SYSLOGD_FLAGS= ${SYSLOGD_PIDNAME}
|
||||||
SYSLOG_FLAGS= -DALLOW_KERNEL_LOGGING
|
SYSLOG_FLAGS= -DALLOW_KERNEL_LOGGING
|
||||||
KLOGD_FLAGS = ${KLOGD_START_DELAY}
|
KLOGD_FLAGS = ${KLOGD_START_DELAY}
|
||||||
DEB =
|
DEB =
|
||||||
|
@ -814,11 +814,7 @@ int InetInuse = 0; /* non-zero if INET sockets are being used */
|
|||||||
int *finet = NULL; /* Internet datagram sockets */
|
int *finet = NULL; /* Internet datagram sockets */
|
||||||
int Initialized = 0; /* set when we have initialized ourselves */
|
int Initialized = 0; /* set when we have initialized ourselves */
|
||||||
int MarkInterval = 20 * 60; /* interval between marks in seconds */
|
int MarkInterval = 20 * 60; /* interval between marks in seconds */
|
||||||
#ifdef INET6
|
int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */
|
||||||
int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */
|
|
||||||
#else
|
|
||||||
int family = PF_INET; /* protocol family (IPv4 only) */
|
|
||||||
#endif
|
|
||||||
int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */
|
int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */
|
||||||
int MarkSeq = 0; /* mark sequence number */
|
int MarkSeq = 0; /* mark sequence number */
|
||||||
int LastAlarm = 0; /* last value passed to alarm() (seconds) */
|
int LastAlarm = 0; /* last value passed to alarm() (seconds) */
|
||||||
@ -919,11 +915,9 @@ int main(int argc, char *argv[])
|
|||||||
family = PF_INET;
|
family = PF_INET;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef INET6
|
|
||||||
case '6':
|
case '6':
|
||||||
family = PF_INET6;
|
family = PF_INET6;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'A':
|
case 'A':
|
||||||
send_to_all++;
|
send_to_all++;
|
||||||
@ -1381,15 +1375,13 @@ static int *create_inet_sockets(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (r->ai_family == AF_INET6) {
|
if (r->ai_family == AF_INET6) {
|
||||||
if (setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY,
|
if (setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) {
|
||||||
(char *)&on, sizeof(on)) < 0) {
|
|
||||||
logerror("setsockopt (IPV6_ONLY), suspending IPv6");
|
logerror("setsockopt (IPV6_ONLY), suspending IPv6");
|
||||||
close(*s);
|
close(*s);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (setsockopt(*s, SOL_SOCKET, SO_REUSEADDR,
|
if (setsockopt(*s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) {
|
||||||
(char *)&on, sizeof(on)) < 0) {
|
|
||||||
logerror("setsockopt(REUSEADDR), suspending inet");
|
logerror("setsockopt(REUSEADDR), suspending inet");
|
||||||
close(*s);
|
close(*s);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user