Skip to content

Commit

Permalink
Echo requests sent by this module are processed like responses when s…
Browse files Browse the repository at this point in the history
…ent to the and addresses, Update version to 1.1.10 in the package.json file, Added 1.1.10 changes to the Changes section in the README.md file
  • Loading branch information
stephenwvickers committed Apr 2, 2014
1 parent 180d6ec commit 356fd0f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ Bug reports should be sent to <stephen.vickers.sv@gmail.com>.

* Use `raw.Socket.writeChecksum()` instead of manually rendering checksums

## Version 1.1.10 - 02/04/2014

* Echo requests sent by this module are processed like responses when sent to
the `127.0.0.1` and `::1` addresses

# Roadmap

Suggestions and requirements should be sent to <stephen.vickers.sv@gmail.com>.
Expand Down
15 changes: 15 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,21 @@ Session.prototype.onSocketMessage = function (buffer, source) {

var req = this.fromBuffer (buffer);
if (req) {
/**
** If we ping'd ourself (i.e. 127.0.0.1 or ::1) then it is likely we
** will receive the echo request in addition to any corresponding echo
** responses. We discard the request packets here so that we don't
** delete the request from the from the request queue since we haven't
** actually received a response yet.
**/
if (this.addressFamily == raw.AddressFamily.IPv6) {
if (req.type == 128)
return;
} else {
if (req.type == 8)
return;
}

this.reqRemove (req.id);

if (this.addressFamily == raw.AddressFamily.IPv6) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "net-ping",
"version": "1.1.9",
"version": "1.1.10",
"description": "Ping and trace route to many hosts at once.",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 356fd0f

Please sign in to comment.