CVSROOT:        /cvs
Module name:    src
Changes by:     flor...@cvs.openbsd.org 2020/10/21 05:11:58

Modified files:
        sbin/ping      : ping.c 

Log message:
ICMP raw sockets start to receive packets as soon as they are created
by socket(2). They also receive all ICMP packets on the system, for
example from parallel running ping(8)s.

After creating the raw socket ping(8) sets various socket options with
setsockopt(2) and assumes that they apply to all packets it later
processes.

For example ping6(8) uses setsockopt(IPV6_RECVHOPLIMIT) to print the
IPv6 hop count. Packets received between the socket(2) and
setsockopt(2) call however do not have the hoplimit information and
ping6(8) prints a wrong and missleading warning.

To avoid this we have to drain our socket of packets we received
before we were fully setup.

Problem reported and testing by martijn
Input deraadt
OK benno

Reply via email to