prober: icmp: Initialize ID and sequence to random values (#412)
prober: icmp: Initialize ID and sequence to random values (#412)

This should help preventing issues with some network devices that have
trouble NATing ICMP packets with the same ID and sequence nubmer but a
different source IP address.

Currently, this can happen if the blackbox_exporter runs in a container
(the ID is set to the PID, which is typically 1 in a container), and
serveral blackbox_exporters are restarted at the same time (the sequence
numbers are reset to zero and stay in sync).

This commit sets the ICMP echo ID to a random value if the PID is 1, and
initializes the sequence number at a random offset.

See #411 for details.

Signed-off-by: Benoît Knecht <2d06b2aecb2b450e75eada92208fcde4791c17df@fsfe.org>
prometheus/blackbox_exporter