Coder Social home page Coder Social logo

Comments (6)

slackpad avatar slackpad commented on June 3, 2024 1

Yep I'll pull this through Serf and Consul - /cc @dadgar for Nomad.

from memberlist.

slackpad avatar slackpad commented on June 3, 2024

@sean- any thoughts on this one?

from memberlist.

sean- avatar sean- commented on June 3, 2024

This is the express reason why hashicorp/go-sockaddr sorts its addresses before making an address selection. Jiggling the sort order of utils.go's privateBlocks is suboptimal, but pragmatic in a pinch (

memberlist/util.go

Lines 25 to 34 in 9800c50

/*
* Contains an entry for each private block:
* 10.0.0.0/8
* 100.64.0.0/10
* 127.0.0.0/8
* 169.254.0.0/16
* 172.16.0.0/12
* 192.168.0.0/16
*/
var privateBlocks []*net.IPNet
).

From a correctness perspective, there are a few possible solutions, some more correct than others, but all solutions involve the use of hashicorp/go-sockaddr (mostly because that's the bestest hammer available, imnsho! 😁 ).

@woodsaj , can you run the following few commands and see if they're correct for your environment:

$ go get -u github.com/hashicorp/go-sockaddr/cmd/sockaddr
$ sockaddr eval GetPrivateIP

from memberlist.

woodsaj avatar woodsaj commented on June 3, 2024
$ sockaddr eval GetPrivateIP
192.168.0.102

looks to work correctly. :)

from memberlist.

sean- avatar sean- commented on June 3, 2024

Ha!, excellent. Thank you for that point of validation.

@slackpad, your call now. :) I'm game for PRing this at some point unless you beat me to it. As far as impact, Consul already has a vendor dependency on go-sockaddr so that's a no op there. As far as other public projects, Serf and Nomad will need love because there will be a new library dependency. It's not that high on my list to tackle atm, but I can squeeze it in if needed.... or I'll do it on the train this morning (#108).

from memberlist.

slackpad avatar slackpad commented on June 3, 2024

Should be fixed at this level by #108.

from memberlist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.