-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic IPv6 support. #67
Conversation
The following changes were made to support pinging IPv6 hosts: - On Linux and macOS, use `/sbin/ping6` as the executable - On macOS, if pinging an IPv6 host, don't pass a timeout argument
Hello, can you also provide the test cases and fixtures for your ipv6 codes?
2017年6月20日 23:03,"Elad Efrat" <notifications@github.com>寫道:
… The following changes were made to support pinging IPv6 hosts:
- On Linux and macOS, use /sbin/ping6 as the executable
- On macOS, if pinging an IPv6 host, don't pass a timeout argument
------------------------------
You can view, comment on, or merge this pull request online at:
#67
Commit Summary
- Add basic IPv6 support.
File Changes
- *M* lib/builder/factory.js
<https://github.com/danielzzz/node-ping/pull/67/files#diff-0> (6)
- *M* lib/builder/mac.js
<https://github.com/danielzzz/node-ping/pull/67/files#diff-1> (2)
- *M* lib/ping-promise.js
<https://github.com/danielzzz/node-ping/pull/67/files#diff-2> (2)
Patch Links:
- https://github.com/danielzzz/node-ping/pull/67.patch
- https://github.com/danielzzz/node-ping/pull/67.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#67>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADuAoyaDHBzojyCYo2pUWkuny-Ihm3EYks5sF980gaJpZM4N_uGw>
.
|
@@ -74,11 +74,11 @@ factory.getExecutablePath = function (platform) { | |||
if (platform === 'aix') { | |||
ret = '/usr/sbin/ping'; | |||
} else if (factory.isLinux(platform)) { | |||
ret = '/bin/ping'; | |||
ret = v6 ? '/sbin/ping6' : '/bin/ping'; | |||
} else if (factory.isWindow(platform)) { | |||
ret = process.env.SystemRoot + '/system32/ping.exe'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering whether we should support the '-6' for windows command, per docs: https://ss64.com/nt/ping.html
BTW I don't have access to to Windows machine to validate this behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we probably should. I can test on Windows. I'll make the code force either IPv4 or IPv6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(done, on merge we should squash with the latest commit)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, how to create a message box with review icon like this? Any button in github UI for doing this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mondwan click "Files changed" at the top, then hover over the line number and click when you want to add a line-specific comment. :)
The following changes were made to support pinging IPv6 hosts: - On Linux and macOS, use `/sbin/ping6` as the executable - On macOS, if pinging an IPv6 host, don't pass a timeout argument - On Windows, use `-4` and `-6` to force IPv4 and IPv6, respectively
@mondwan sure, I'll try to get to it later today. |
Great. Thanks @elad |
Cool. Thanks
2017年6月21日 下午5:47,"Elad Efrat" <notifications@github.com>寫道:
… ***@***.**** commented on this pull request.
------------------------------
In lib/builder/factory.js
<#67 (comment)>:
> @@ -74,11 +74,11 @@ factory.getExecutablePath = function (platform) {
if (platform === 'aix') {
ret = '/usr/sbin/ping';
} else if (factory.isLinux(platform)) {
- ret = '/bin/ping';
+ ret = v6 ? '/sbin/ping6' : '/bin/ping';
} else if (factory.isWindow(platform)) {
ret = process.env.SystemRoot + '/system32/ping.exe';
@mondwan <https://github.com/mondwan> click "Files changed" at the top,
then hover over the line number and click when you want to add a
line-specific comment. :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADuAo0SJi7VOvnqWKj0bNskACpZyKvKPks5sGOajgaJpZM4N_uGw>
.
|
@mondwan how do you run the tests?
|
It seems you are running correct command. Hopefully, you are using stricter
eslintrc?
2017年6月27日 21:57,"Elad Efrat" <notifications@github.com>寫道:
… @mondwan <https://github.com/mondwan> how do you run the tests?
$ yarn test
yarn test v0.24.6
$ grunt test
Running "eslint:src" (eslint) task
/private/tmp/node-ping/lib/parser/mac.js
39:28 error Unnecessary escape character: \. no-useless-escape
56:31 error Unnecessary escape character: \/ no-useless-escape
58:28 error Unnecessary escape character: \. no-useless-escape
/private/tmp/node-ping/lib/parser/win.js
83:28 error Unnecessary escape character: \. no-useless-escape
103:28 error Unnecessary escape character: \. no-useless-escape
✖ 5 problems (5 errors, 0 warnings)
Warning: Task "eslint:src" failed. Use --force to continue.
Aborted due to warnings.
error Command failed with exit code 3.
$
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADuAo9PC8BRHsCA7ngY3Iw54hV66aw0hks5sIQpNgaJpZM4N_uGw>
.
|
I have no idea. I just cloned the repository, installed the dependencies, and ran the command. Testing on macOS Sierra. What's your environment? |
What's the problem?
Grunt test states codes in the repository does not meeting the linter's
rules. So, you need to edit those lines mentioned until they have passed
the rules.
After lintering success, testing will be start.
2017年6月27日 下午10:04,"Elad Efrat" <notifications@github.com>寫道:
… I have no idea. I just cloned the repository, installed the dependencies,
and ran the command. Testing on macOS Sierra. What's your environment?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADuAo6y9fNEdAMd07CWH56nu_stwzXRaks5sIQvTgaJpZM4N_uGw>
.
|
Those lines are checked out from the repository... they're not related to my changes. |
Oops. Hopefully, I have made some mistakes last time. Would you mind to fix
them for me? As I am busy at this moment, it may take time for fixing these.
2017年6月27日 下午10:12,"Elad Efrat" <notifications@github.com>寫道:
Those lines are checked out from the repository... they're not related to
my changes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADuAoxB-GTZOjQdrVkvWa-6D8_BhGOXbks5sIQ2QgaJpZM4N_uGw>
.
|
Ahh, I just found out linting errors from yours do not happen on my window machine. That's why I cannot spot them out. |
@mondwan you should consider switching to macOS then. :) |
@elad , test cases are still missing. Can you provide examples for running with ipv6? For example,
|
Yea. Development in Window is bad. Really bad. I will do them on my mac book air if they are heavy. However, this is a kind of fun for seeing tricky things which happen on window platform only. LOL |
Another option is using Vagrant/Virtual Box? |
Which one?
2017年7月3日 05:06,"Andre-John Mas" <notifications@github.com>寫道:
… Another option is using Vagrant/Virtual Box?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADuAo2SQqxwlVxMCZNz5dIO8ZVV_wAzMks5sKAZkgaJpZM4N_uGw>
.
|
Hey @elad, may I know the reason for not passing timeout when using ipv6 on mac OS? |
The following changes were made to support pinging IPv6 hosts:
/sbin/ping6
as the executable