Skip to content

test/dgram: Add support for IPv6 link local scope IDs in received UDP datagrams#14500

Closed
pekkanikander wants to merge 1 commit intonodejs:masterfrom
Ell-i:feature-udp6-received-link-local-address-scope-id
Closed

test/dgram: Add support for IPv6 link local scope IDs in received UDP datagrams#14500
pekkanikander wants to merge 1 commit intonodejs:masterfrom
Ell-i:feature-udp6-received-link-local-address-scope-id

Conversation

@pekkanikander
Copy link
Contributor

@pekkanikander pekkanikander commented Jul 26, 2017

A new test case to verify that IPv6 UDP datagrams
received from a link-local source address do contain
the scope ID suffix in the rinfo address field.

Add IPv6 link local scope ID suffix to the
rinfo address in those received upd6 datagrams
whose source address is a link local address.

When a packet is received from a link-local source
address, if the address does not contain the scope
ID suffix, it is impossible to reply back to the
sender, as the kernel is not able to determine
the right network interface to send the packet
through and returns with an error.

Ref: #1649

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

test, dgram

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Jul 26, 2017
@pekkanikander pekkanikander force-pushed the feature-udp6-received-link-local-address-scope-id branch from f53d11e to 842bd12 Compare July 26, 2017 12:03
@pekkanikander pekkanikander force-pushed the feature-udp6-received-link-local-address-scope-id branch from 47e6c7b to f0e506c Compare July 26, 2017 12:21
@pekkanikander pekkanikander changed the title test: add test-dgram-udp6-link-local-address test/dgram: Add support for IPv6 link local scope IDs in received UDP datagrams Jul 26, 2017
@pekkanikander pekkanikander force-pushed the feature-udp6-received-link-local-address-scope-id branch from f0e506c to 79392ac Compare July 26, 2017 14:57
@mscdex
Copy link
Contributor

mscdex commented Jul 26, 2017

Changes to libuv need to go upstream first. Also FWIW, Windows support seems to be missing.

@mscdex mscdex added the libuv Issues and PRs related to the libuv dependency or the uv binding. label Jul 26, 2017
@pekkanikander
Copy link
Contributor Author

Any chance of getting any help with Windows? I haven't used Windows since 2001 or so.

@mscdex
Copy link
Contributor

mscdex commented Jul 26, 2017

@pekkanikander You might ask when posting your issue/PR on the libuv repo.

@bzoz
Copy link
Contributor

bzoz commented Aug 16, 2017

@pekkanikander as you found in the libuv/libuv#1445, Windows uses interface numbers as scope id. This makes Windows change in tcp_wrap.cc much simpler:

// Add an interface identifier to a link local address
if (IN6_IS_ADDR_LINKLOCAL(&a6->sin6_addr)) {
    sprintf(ip + strlen(ip), "%%%d", a6->sin6_scope_id);
}

With this and following change to the test-dgram-udp6-link-local-address.js:

// Map the interface into its address, with interface ID
    .map((iface) => iface.address + '%' + iface.scopeid)

the test passes on Windows.

@jasnell jasnell added the blocked PRs that are blocked by other issues or PRs. label Aug 24, 2017
@jasnell
Copy link
Member

jasnell commented Aug 24, 2017

Marking this a being blocked on libuv

@jasnell jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Aug 24, 2017
cjihrig pushed a commit to libuv/libuv that referenced this pull request Nov 6, 2017
uv_if_indextoname() is used to convert an IPv6 scope_id
to an interface identifier string such as %eth0 or %lo.

uv_if_indextoiid() returns an IPv6 interface identifier.
On Unix it calls uv_if_indextoname(). On Windows it uses
snprintf() to return the numeric interface identifier as
a string.

Refs: nodejs/node#14500
PR-URL: #1445
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@pekkanikander pekkanikander force-pushed the feature-udp6-received-link-local-address-scope-id branch from 79392ac to 2ccca4c Compare November 8, 2017 11:50
@pekkanikander
Copy link
Contributor Author

Manually updated, with the the required changes from upstream libuv 1.16.0.

@cjihrig
Copy link
Contributor

cjihrig commented Nov 10, 2017

@pekkanikander please remove the libuv commit and rebase this PR. libuv 1.16.1 is now on master.

@pekkanikander pekkanikander force-pushed the feature-udp6-received-link-local-address-scope-id branch from 2ccca4c to de58e96 Compare November 10, 2017 19:39
@pekkanikander
Copy link
Contributor Author

Updated.

@pekkanikander
Copy link
Contributor Author

@bnoordhuis Ben, any idea when you will have time to review this PR? I have some time to handle review comments this week, but next week not. Next week I will be travelling with a quite busy schedule.

@lpinca
Copy link
Member

lpinca commented Jul 14, 2020

@sxa yes it makes sense. I think that fix should go in a separate PR. Feel free to open it. We can then rebase this on top of it.

sxa pushed a commit to sxa/node that referenced this pull request Jul 14, 2020
Zone IDs on Linux are network interface names. The regex we use to
determine valid IPs does not allow for non-alphanumeric characters
in the zone ID suffix. Some machines (including the RHEL Linux/s390x
machines from Marist) have zone IDs with a '.' character in them
which the regex in net.isIP rejects. This changes the regex.

Ref: nodejs#14500

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>
mhdawson pushed a commit that referenced this pull request Jul 16, 2020
Zone IDs on Linux are network interface names. The regex we use to
determine valid IPs does not allow for non-alphanumeric characters
in the zone ID suffix. Some machines (including the RHEL Linux/s390x
machines from Marist) have zone IDs with a '.' character in them
which the regex in net.isIP rejects. This changes the regex.

Ref: #14500

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

PR-URL: #34364
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@nodejs-github-bot
Copy link
Collaborator

@sxa
Copy link
Member

sxa commented Jul 20, 2020

The new test passes on LinuxOne after #34364 landed. @Trott do you still have a concern over this given that node-test-commit-windows-fanned looks ok? Everything finally looks green here - maybe we'll get this in before the three year mark :-D

@Trott
Copy link
Member

Trott commented Jul 21, 2020

@Trott do you still have a concern over this given that node-test-commit-windows-fanned looks ok?

Yes. It's very suspicious that no tests have failed. I'm concerned.

No, just kidding, OMG, yes, let's land this thing.

@Trott Trott dismissed their stale review July 21, 2020 02:48

tests passing

@lpinca
Copy link
Member

lpinca commented Jul 21, 2020

Do it!

@lpinca lpinca removed the stalled Issues and PRs that are stalled. label Jul 21, 2020
Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last push was by @Trott and the landing tool is objecting that there have been no more formal approvals since the last push, so I'm going to approve Trott's changes from a few weeks back and let this land :-D

sxa pushed a commit that referenced this pull request Jul 21, 2020
Add IPv6 link local scope ID suffix to the
rinfo address in those received upd6 datagrams
whose source address is a link local address.

Add a new test case, test-dgram-udp6-link-local-address,
to verify that IPv6 UDP datagrams received from a
link-local source address do contain the scope ID
suffix in the rinfo address field.

When a packet is received from a link-local source
address, if the address does not contain the scope
ID suffix, it is impossible to reply back to the
sender, as the kernel is not able to determine
the right network interface to send the packet
through and returns with an error.

Ref: #1649
PR-URL: #14500

Refs: #1649
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Stewart X Addison <sxa@uk.ibm.com>
@sxa
Copy link
Member

sxa commented Jul 21, 2020

Landed in bdf6827 - thanks everyone - we got this PR in five days before it got to it's third birthday 😅 🍾

@sxa sxa closed this Jul 21, 2020
@pekkanikander
Copy link
Contributor Author

A big thank you 🙏🙏 for your perseverance and efforts on getting this humble fix finally landed!

cjihrig pushed a commit that referenced this pull request Jul 23, 2020
Zone IDs on Linux are network interface names. The regex we use to
determine valid IPs does not allow for non-alphanumeric characters
in the zone ID suffix. Some machines (including the RHEL Linux/s390x
machines from Marist) have zone IDs with a '.' character in them
which the regex in net.isIP rejects. This changes the regex.

Ref: #14500

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

PR-URL: #34364
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
cjihrig pushed a commit that referenced this pull request Jul 23, 2020
Add IPv6 link local scope ID suffix to the
rinfo address in those received upd6 datagrams
whose source address is a link local address.

Add a new test case, test-dgram-udp6-link-local-address,
to verify that IPv6 UDP datagrams received from a
link-local source address do contain the scope ID
suffix in the rinfo address field.

When a packet is received from a link-local source
address, if the address does not contain the scope
ID suffix, it is impossible to reply back to the
sender, as the kernel is not able to determine
the right network interface to send the packet
through and returns with an error.

Ref: #1649
PR-URL: #14500

Refs: #1649
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Stewart X Addison <sxa@uk.ibm.com>
MylesBorins pushed a commit that referenced this pull request Jul 27, 2020
Zone IDs on Linux are network interface names. The regex we use to
determine valid IPs does not allow for non-alphanumeric characters
in the zone ID suffix. Some machines (including the RHEL Linux/s390x
machines from Marist) have zone IDs with a '.' character in them
which the regex in net.isIP rejects. This changes the regex.

Ref: #14500

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

PR-URL: #34364
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins pushed a commit that referenced this pull request Jul 27, 2020
Add IPv6 link local scope ID suffix to the
rinfo address in those received upd6 datagrams
whose source address is a link local address.

Add a new test case, test-dgram-udp6-link-local-address,
to verify that IPv6 UDP datagrams received from a
link-local source address do contain the scope ID
suffix in the rinfo address field.

When a packet is received from a link-local source
address, if the address does not contain the scope
ID suffix, it is impossible to reply back to the
sender, as the kernel is not able to determine
the right network interface to send the packet
through and returns with an error.

Ref: #1649
PR-URL: #14500

Refs: #1649
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Stewart X Addison <sxa@uk.ibm.com>
ruyadorno added a commit that referenced this pull request Jul 28, 2020
Notable changes:

dgram:
  * (SEMVER-MINOR) add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) #14500
doc:
  * add AshCripps to collaborators (AshCripps) #34494
  * add HarshithaKP to collaborators (Harshitha K P) #34417
  * add rexagod to collaborators (Pranshu Srivastava) #34457
  * add release key for Richard Lau (Richard Lau) #34397
events:
  * (SEMVER-MINOR) expand NodeEventTarget functionality (Anna Henningsen) #34057
src:
  * (SEMVER-MINOR) allow preventing SetPromiseRejectCallback (Shelley Vohr) #34387
  * (SEMVER-MINOR) allow setting a dir for all diagnostic output (AshCripps) #33584
worker:
  * (SEMVER-MINOR) make MessagePort inherit from EventTarget (Anna Henningsen) #34057

PR-URL: TODO
@ruyadorno ruyadorno mentioned this pull request Jul 28, 2020
@Jeewes
Copy link

Jeewes commented Aug 12, 2020

This has been a joy to follow. Good job people. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libuv Issues and PRs related to the libuv dependency or the uv binding. semver-minor PRs that contain new features and should be released in the next minor version. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.