Do not restart a inetd service if the listening interface is changed.
Only bring down established connection which are no longer allowed,
i.e. do not touch already allowed established connections.
Signed-off-by: Jonas Johansson <jonasj76@gmail.com>
Per service rlimit is new in v3.1. When an inetd service connection is
created we do a selective copy from the parent inetd. We also need to
copy the parent's rlimits, otherwise the child will be killed as soon
as the kernel starts it.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Validate function argument
- Skip¹ shutdown() when closing a TCP socket, not needed
___
¹ also, shutdown() segfaults a late shutdown/reboot
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Previously UDP packets were never dropped and if a request came
from a not valid interface inetd got stuck in an inifinite
loop looking at the same packet every time and not dropping it.
Signed-off-by: Lennart Eriksson <lennart.eriksson@westermo.se>
When alibuEv event watcher callback has `UEV_ERROR` in the events mask
we must handle the error. Unfortunately, in most cases there is not
much we can do but ignore it or log the error.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
In GCC 7 the -Wall infers the new -Wformat-truncation which finds
problems with string truncation in functions like snprintf().
This patch suppresses the warning by allowing only a subset of the
parent inetd service description to be copied to the child connection.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
getprotobyname() returns p_proto in host endian, so it should not be
converted with ntoh. (Note: getservbyname() on the other hand does
return s_port in network endian)
Signed-off-by: Petrus Hellgren <petrus.hellgren@westermo.se>