You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To listen for Broadcast packets using the net library one omits the interface IP:
l, err := net.ListenPacket("udp4", ":67") // Listen for DHCP Request
Packets
Unfortunately, this listens on all interfaces, rather than allowing the developer to
select the correct one.
Likewise, responses will travel over the main interface, which may differ from where the
client packets originate.
Being able to specify the interface would solve both problems.
Net already supports Multicast Interfaces (with special functions), maybe Broadcast
could be given similar treatment.
The text was updated successfully, but these errors were encountered:
I will close this issue as "working as intended" because basically it's designed to behave like so inside the protocol stack, and we also have x/net/{ipv4,ipv6} packages that provide ancillary information handling including destination IP address on each inbound packet.
Binding an IP network interface to a connection endpoint might be useful if the behavior is consistent, if it's crystal clear how IP routing stuff treats inbound host delivery packets when the network interface has been brought down or there's no routable addresses assigned to the network interface, but that should be another issue.
by krolaw:
The text was updated successfully, but these errors were encountered: