-
Notifications
You must be signed in to change notification settings - Fork 8
Review by kuba #1
Comments
I would rename this variable: https://github.com/libp2p/go-reuseport-transport/blob/master/reuseport.go#L59 it was a bit confusing at first. Shouldn't we use |
We might want to catch: |
Different source or target? We always use the unspecified IP address for the source (this library just picks the source port). It's up to the transport to try multiple target addresses. |
In case of a local network, we use a random address for Dial afaik. |
We pick a random source port from the set of reasonable source ports but we never manually specify the source address. Note: The swarm no longer specifies source addresses when dialing. I moved that logic into the transport because the swarm doesn't really know enough to do so intelligently. Really, the correct way to implement this library would be to:
Unfortunately, the "ask the kernel" part involves using netlink. We could do this (e.g., with the netlink package) but that adds some complexity (and I'd like to do it later, if ever). |
No, but that needs a comment. Basically, we always prefer using the unspecified address over the global address because we don't actually know if the global address can dial the target. The logic is:
|
Changes: 73d48b5...f431c22 |
@Kubuxu when you get a chance, final review? |
SGWM |
indirectly addresses: libp2p/go-reuseport-transport#1 (comment)
No description provided.
The text was updated successfully, but these errors were encountered: