Skip to content

Commit

Permalink
Remove net/open/dragonfly bsd, qnx
Browse files Browse the repository at this point in the history
These oses don't have igmpv3 support in their kernels.
So cannot be supported by igmpv3proxy
  • Loading branch information
Uglymotha committed Jul 14, 2024
1 parent 747bd04 commit 3e1321e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ AC_CANONICAL_HOST
case $host_os in
linux*|uclinux*) os=linux;;
freebsd*) os=freebsd;;
netbsd*) os=netbsd;;
openbsd*) os=openbsd;;
nto*) os=qnxnto;;
dragonfly*) os=dragonfly;;
*) AC_MSG_ERROR([OS $host_os is not supported]);;
esac
AC_CONFIG_LINKS([src/os.h:src/os-${os}.h])
Expand Down
4 changes: 0 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ igmpv3proxy_SOURCES = \
igmpv3proxy.h \
kern.c \
lib.c \
os-dragonfly.h \
os-freebsd.h \
os-linux.h \
os-netbsd.h \
os-openbsd.h \
os-qnxnto.h \
mctable.c \
querier.c \
timers.c
15 changes: 9 additions & 6 deletions src/igmpv3proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ static void igmpProxyMonitor(void) {
struct timespec timeout = timer_ageQueue();
LOG(LOG_NOTICE, 0, "Monitoring %d proxy processes.", chld.nr);

rebuildIfVc(NULL);
sigstatus = 0;
// Simple busy sleeping loop here, it suits our needs.
do {
Expand Down Expand Up @@ -400,10 +401,13 @@ static void igmpProxyMonitor(void) {
}
}
sigstatus = 0;
// SIGCHLD or loadConfig() may have forked new process, it will end up here.
if (mrt_tbl >= 0 && (sigstatus = 1))
// New proxy has config now, sigstatus = startup, so can return to igmpProxyInit().
return;
// SIGCHLD or loadConfig() may have forked new proxy, set sigstatus to STARTUP.
if (mrt_tbl >= 0) {
// New proxy can keep using the (universal) config, but needs to create its own interface list.
freeIfDescL(true);
sigstatus = 1;
return; // To igmpProxyInit()
}
timeout = timer_ageQueue();
if (timeout.tv_sec < 0)
timeout = (struct timespec){ 2147483647, 0 };
Expand Down Expand Up @@ -484,9 +488,7 @@ static void igmpProxyInit(void) {
LOG(LOG_INFO, 0, "Forked child: %d PID: %d for table: 0.", chld.nr + 1, pid);
chld.c[chld.nr].pid = pid;
chld.c[chld.nr++].tbl = 0;
rebuildIfVc(NULL);
igmpProxyMonitor();
freeIfDescL(true); // If we continue as proxy process empty the interfaes table in use by the monitor.
} else if (pid == 0)
// Child (or only process) becomes proxy for default mrt table 0.
chld.nr++;
Expand Down Expand Up @@ -627,6 +629,7 @@ static void signalHandler(int sig, siginfo_t* siginfo, void* context) {
IF_FOR_IF(mrt_tbl < 0 && chld.c, i = 0; i < chld.nr; i++, chld.c[i].pid == siginfo->si_pid) {
chld.c[i].sig = 1;
chld.c[i].st = (int8_t)siginfo->si_status;
break;
}
}
// Send SIG to children, except for SIGINT SIGPIPE and SIGCHLD.
Expand Down

0 comments on commit 3e1321e

Please sign in to comment.