Bug 222240 - multiple ICMP echo requests reported when ping broadcast
Summary: multiple ICMP echo requests reported when ping broadcast
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: George V. Neville-Neil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-11 20:56 UTC by hannes
Modified: 2017-09-12 14:58 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hannes 2017-09-11 20:56:38 UTC
When I send a broadcast ping, and run tcpdump on the same host, I see multiple ICMP echo requests in tcpdump (with slightly different timestamps).  Running a tcpdump on a different host in the same broadcast domain only sees one ICMP echo request!.

# ping 192.168.0.255
PING 192.168.0.255 (192.168.0.255): 56 data bytes
...

# tcpdump -lni wlan0 icmp
21:45:41.833915 IP 192.168.0.6 > 192.168.0.255: ICMP echo request, id 22192, seq 0, length 64
21:45:41.833927 IP 192.168.0.6 > 192.168.0.255: ICMP echo request, id 22192, seq 0, length 64
21:45:42.896747 IP 192.168.0.6 > 192.168.0.255: ICMP echo request, id 22192, seq 1, length 64
21:45:42.896758 IP 192.168.0.6 > 192.168.0.255: ICMP echo request, id 22192, seq 1, length 64


I reported this earlier on transport@ (https://lists.freebsd.org/pipermail/freebsd-transport/2016-September/000145.html) and it was cross-posted to net@ (https://lists.freebsd.org/pipermail/freebsd-net/2016-September/046105.html)

gnn@ reported he can reproduce this on 11 as well.

I just checked, and it this behaviour is still present in CURRENT (r322062)
Comment 1 Andrey V. Elsukov freebsd_committer 2017-09-12 14:58:33 UTC
You see two copies of the broadcast packet, because wlan0 has IFF_SIMPLEX flag and ether_output() does if_simloop() for broadcast packets for those interfaces.
Interfaces with IFF_SIMPLEX flag can not receive their own broadcast packets, and  the kernel emulates this behavior. So you can "receive" you own broadcast on the link. You can use tcpdump with -Q in|out flag to check, that one packet is outbound, and other is inbound.