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

Projects
None yet
4 participants
@gopherbot
Copy link

commented Jan 12, 2014

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

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2014

Comment 1:

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

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2014

Comment 2:

Labels changed: added release-none.

Status changed to Accepted.

@griesemer

This comment has been minimized.

Copy link
Contributor

commented Oct 1, 2014

Comment 3:

Labels changed: added repo-main.

@mikioh mikioh added help wanted and removed accepted labels Feb 4, 2015

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed release-none labels Apr 10, 2015

@mikioh mikioh removed the help wanted label Nov 27, 2016

@mikioh

This comment has been minimized.

Copy link
Contributor

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 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.
You can’t perform that action at this time.