Parse IPv6 host & numeric host on Linux #94
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired by #79
Not sure if I've gone about this the right way, but the odd spacing and bracket placement in Linux with
ping6
meant that 'numeric_host' was never getting set. In a project I'm working on I get odd values for 'host' likeone.one.one.one(2606:4700:4700::1111)
I wasn't sure how to deal with responses like the following two where the ping command only gives you an IP address or a hostname and not both. In those cases
host
andnumeric_host
will be the same, ie:I'm tempted to sit on this PR a while and wait for suggestions, as well as try to find a few more machines that I can grab test fixtures from to make sure it does what it should.
Edit: Oh yeah! https://travis-ci.org/texh/node-ping. Node >=4 are all passing, lower versions bail on an error with grunt using too-modern JS.