Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: unable to specify network interface for IPv4 limited/directed broadcast listener. #7106

Closed
gopherbot opened this issue Jan 12, 2014 · 4 comments

Comments

@gopherbot
Copy link

by krolaw:

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.
@mikioh
Copy link
Contributor

mikioh commented Jan 15, 2014

Comment 1:

Sorry, but I have no clue on this issue, leave to others.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 2:

Labels changed: added release-none.

Status changed to Accepted.

@griesemer
Copy link
Contributor

Comment 3:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@mikioh
Copy link
Contributor

mikioh commented Nov 27, 2016

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.

@mikioh mikioh closed this as completed Nov 27, 2016
@golang golang locked and limited conversation to collaborators Nov 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants