project-iris / iris

Decentralized cloud messaging
iris.karalabe.com
Other
571 stars 32 forks source link

Fixed an issue where the DefaultMask was used instead of the actual network mask #8

Closed svanharmelen closed 10 years ago

svanharmelen commented 10 years ago

If, for example, the nodes are on a 10.0.0.0/24 network the DefaultMask will return a /8 network instead of the actually used /24 network. This results in nodes not being able to find each other as they are trying to scan a way to large subnet which takes quite a lot of time.

The reordering of the imports in any files I saved is a result of using goimports to manage the imports for me.

karalabe commented 10 years ago

This looks very nice, a really good catch with the masks. I've only tried on my local networks which didn't have any fancy setup so the default mask issue didn't crop up. Thanks a million for sending this in :)

Btw, I needed to update the bootstrap tests as you haven't ran those, but now they are in sync with the updated code. I've also opened enhancement issue #9 that can now be easier done due to your modifications :)

PS: About the goimports, I'm trying to figure out whether to transition the project over or not. I'll use it a bit and decide then. If a lot of people begin using it then it might be a good idea (otherwise the imports will get all over the place). But first I'd like a feel to it and to see how common it is in bigger libraries/systems (i.e. keep to the convention).

PPS: Added you to the contributors ;) PPPS: With your fix the drone.io builds also finally pass :)

svanharmelen commented 10 years ago

Nice!

And yes, I've should have looked at (and run) the tests also! Will do that next time :)