Description
- Version: v11.0.0-pre
- Platform: Linux (Ubuntu 16.04.4-LTS)
- Subsystem: os
The overwhelming majority of network interfaces are Ethernet or Wifi (on servers, almost always Ethernet) which both support broadcasting. The broadcast address is typically the host address bit-wise ANDed with the net mask, and then bit-wise ORed with the bit-wise complement of the net mask.
But not always. Some arcane network configurations still use zero as the host id to signify the broadcast address (i.e. just the host address bit-wise ANDed with the net mask).
That is, for an address such as 192.168.1.12/24
(i.e. net mask of 255.255.255.0
), the broadcast address would typically be 192.168.1.255
.
That said, the correct behavior is always to take the broadcast address directly from the interface's configuration state, rather than guessing at it.
A mechanism to do exactly that is needed.