Open aikar opened 4 years ago
Awesome. One thought I have is if options.address
has been specified, then we should probably only resolve the broadcast address for the interface that has that address. Reason being, if I am specifying the address I want things bound to, I probably don't want packets broadcast on all interfaces.
It is possible that there is not an interface with the specified address though (sysctl -w net.ipv4.ip_nonlocal_bind=1
), so, in that case I'd probably just broadcast to all interfaces.
Oh, to follow on that feedback i noticed you said address now and not broadcast.
I can see what you mean now. Not sure best way to implement that though.
I assume would have to compare address to cidr/netmask to compare?
Are you able to implement those changes? (you do have push to my branch for this PR)
Hi!, are you merging this fix? because I'm having the same issue, my node connects to the other nodes an receives data but those nodes doesn't know about mine and I can't send data. I change the code with this PR and it worked.
Look up all available interfaces and build an array of destinations for each for broadcast.
Resolves a TODO you had here.
Used a library to implement the logic of turning an address and netmask into a broadcast address.
Have tested this locally where I have 2 ifaces available (wireless and wired), another machine only had 1 (wireless) Previously had issues where my outbound packets only went out wired, so the wireless client could not receive mine, however I could receive the wireless packets as I was also on wireless.
This resolves the issue by sending my outbound over both wired and wireless.
Resolves #26