Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6be405b

Browse filesBrowse files
targosBethGriggs
authored andcommitted
test: fix test-dgram-udp6-link-local-address on Windows
PR-URL: #40005 Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent b6939a3 commit 6be405b
Copy full SHA for 6be405b

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-dgram-udp6-link-local-address.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dgram-udp6-link-local-address.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const assert = require('assert');
77
const dgram = require('dgram');
88
const os = require('os');
99

10+
const { isWindows } = common;
11+
1012
function linklocal() {
1113
for (const [ifname, entries] of Object.entries(os.networkInterfaces())) {
1214
for (const { address, family, scopeid } of entries) {
@@ -21,7 +23,7 @@ const iface = linklocal();
2123
if (!iface)
2224
common.skip('cannot find any IPv6 interfaces with a link local address');
2325

24-
const address = `${iface.address}%${iface.ifname}`;
26+
const address = isWindows ? iface.address : `${iface.address}%${iface.ifname}`;
2527
const message = 'Hello, local world!';
2628

2729
// Create a client socket for sending to the link-local address.
@@ -42,7 +44,7 @@ server.on('message', common.mustCall((buf, info) => {
4244
// including the link local scope identifier.
4345
assert.strictEqual(
4446
info.address,
45-
common.isWindows ? `${iface.address}%${iface.scopeid}` : address
47+
isWindows ? `${iface.address}%${iface.scopeid}` : address
4648
);
4749
server.close();
4850
client.close();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.