This is an approximation, as enabling SO_KEEPALIVE doesn't mean that
a keep-alive segment will be sent right away, rather that keep-alive
segments will start being sent if the connection is idle.
On the other hand, we don't have direct control over the host-side
TCP, so this is probably the best approximation we can get.
By default, namespaces inherit keep-alive parameters from their parent
namespace, so we can assume that, in case of a container, we'll wait
for the same interval it took for the container to start sending us
keep-alives, effectively doubling that interval.
To keep this simple, set SO_KEEPALIVE whenever we see a keep-alive
segment, instead of tracking its state. Keep-alive segments are
relatively infrequent, so we don't expect any substantial cost from
doing that.
Reported-by: Dominic Kohls