Skip to content

Commit 6be405b

Browse 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

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const assert = require('assert');
77
constdgram=require('dgram');
88
constos=require('os');
99

10+
const{ isWindows }=common;
11+
1012
functionlinklocal(){
1113
for(const[ifname,entries]ofObject.entries(os.networkInterfaces())){
1214
for(const{ address, family, scopeid }ofentries){
@@ -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-
constaddress=`${iface.address}%${iface.ifname}`;
26+
constaddress=isWindows ? iface.address : `${iface.address}%${iface.ifname}`;
2527
constmessage='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)