Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2021 20:49:39 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 252596] ping to 255.255.255.255 does not set broadcast MAC
Message-ID:  <bug-252596-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252596

            Bug ID: 252596
           Summary: ping to 255.255.255.255 does not set broadcast MAC
           Product: Base System
           Version: CURRENT
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: jcaplan@blackberry.com

Summary: When pinging the ip address 255.255.255.255, the MAC address shoul=
d be
set to the broadcast address.



Description:

I narrowed this down to sys/netinet/ip_output.c where it looks like the
decision about whether to set M_BCAST is happening on line 505 for this cas=
e:

isbroadcast =3D in_ifaddr_broadcast(gw->sin_addr, ia);

It looks like in_ifaddr_broadcast is only checking whether the address is t=
he
same as the interface broadcast (e.g. 192.168.122.255), but not
255.255.255.255.

If I ping 192.168.122.255, then I get the expected MAC broadcast address.


Actual results:
--------------

tcpdump -vvvv -xx -ni em0 icmp &
ping -nc 1 255.255.255.255

root@bsd-vbox:/home/jcaplan # tcpdump -vvvv -xx -ni em0 icmp &
[1] 5429
root@bsd-vbox:/home/jcaplan # tcpdump: listening on em0, link-type EN10MB
(Ethernet), capture size 262144 bytes

root@bsd-vbox:/home/jcaplan # ping -nc 1 255.255.255.255
PING 255.255.255.255 (255.255.255.255): 56 data bytes
02:01:55.895257 IP (tos 0x0, ttl 64, id 46687, offset 0, flags [none], proto
ICMP (1), length 84)
    192.168.1.32 > 255.255.255.255: ICMP echo request, id 13845, seq 0, len=
gth
64
        0x0000:  3c37 862c 1f63 0800 27b8 57c0 0800 4500

Note the first six bytes are not 0xff.


Expected Results:
----------------


root@bsd-vbox:/home/jcaplan # tcpdump -vvvv -xx -ni em0 icmp &
[1] 5429
root@bsd-vbox:/home/jcaplan # tcpdump: listening on em0, link-type EN10MB
(Ethernet), capture size 262144 bytes

root@bsd-vbox:/home/jcaplan # ping -nc 1 255.255.255.255
PING 255.255.255.255 (255.255.255.255): 56 data bytes
02:01:55.895257 IP (tos 0x0, ttl 64, id 46687, offset 0, flags [none], proto
ICMP (1), length 84)
    192.168.1.32 > 255.255.255.255: ICMP echo request, id 13845, seq 0, len=
gth
64
        0x0000:  ffff ffff ffff 0800 27b8 57c0 0800 4500


Note the first 6 bytes are 0xff.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-252596-227>