Skip to content

Commit 6be405b

Browse files
targosBethGriggs
authored andcommittedSep 21, 2021
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

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

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

+4-2
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)
Please sign in to comment.