Bug 224920 - limited broadcast for Linux programs
Summary: limited broadcast for Linux programs
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Blocks: 247219
  Show dependency treegraph
Reported: 2018-01-05 02:08 UTC by Henry Hu
Modified: 2020-10-15 20:31 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Henry Hu 2018-01-05 02:08:20 UTC
Limited broadcast, or sending to, is the behavior specified in RFC 947, which is deprecated (https://wiki.freebsd.org/NetworkRFCCompliance). As a result, FreeBSD does not support it (sending to results in an ether address of the default gw), unless IP_ONESBCAST is specified.
However, for Linux programs, it seems to be still expected to work. Some programs send UDP packets to to discover devices on local network. One such example is Canon's ScanGear MP program, which uses this way to discover local scanners.

Sample trace:

21:06:37.887917 b0:6e:bf:2a:e7:23 > 04:a1:51:15:5e:11, ethertype IPv4 (0x0800), length 166: >  C="canon_admin" GetRequest(104)  . . . . .


21:05:46.430205 b0:6e:bf:2a:e7:23 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 166: >  C="canon_admin" GetRequest(104)  . . . . .

Since FreeBSD does not support this, this program cannot discover any devices.
The discovery code is in some binary blob, which is unable to be changed. For a closer emulation of Linux behavior, I suggest that when running Linux programs, we send a broadcast packet to the interface of the default route.

A workaround is letting ipfw do a forward:

fwd udp from me to