| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9890eaa commit 2c4f670
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -940,7 +940,14 @@ const common = { | |||
| 940 | 940 | ||
| 941 | 941 | get hasIPv6() { | |
| 942 | 942 | const iFaces = require('os').networkInterfaces(); | |
| 943 | - const re = isWindows ? /Loopback Pseudo-Interface/ : /lo/; | ||
| 943 | + let re; | ||
| 944 | + if (isWindows) { | ||
| 945 | + re = /Loopback Pseudo-Interface/; | ||
| 946 | + } else if (this.isIBMi) { | ||
| 947 | + re = /\*LOOPBACK/; | ||
| 948 | + } else { | ||
| 949 | + re = /lo/; | ||
| 950 | + } | ||
| 944 | 951 | return Object.keys(iFaces).some((name) => { | |
| 945 | 952 | return re.test(name) && | |
| 946 | 953 | iFaces[name].some(({ family }) => family === 'IPv6'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -217,6 +217,10 @@ if (common.hasIPv6) { | |||
| 217 | 217 | assert.strictEqual(error.message, `connect ECONNREFUSED ::1:${port}`); | |
| 218 | 218 | } else if (error.code === 'EAFNOSUPPORT') { | |
| 219 | 219 | assert.strictEqual(error.message, `connect EAFNOSUPPORT ::1:${port} - Local (undefined:undefined)`); | |
| 220 | + } else if (common.isIBMi) { | ||
| 221 | + // IBMi returns EUNATCH (ERRNO 42) when IPv6 is disabled | ||
| 222 | + // keep this errno assertion until EUNATCH is recognized by libuv | ||
| 223 | + assert.strictEqual(error.errno, -42); | ||
| 220 | 224 | } else { | |
| 221 | 225 | assert.strictEqual(error.code, 'EADDRNOTAVAIL'); | |
| 222 | 226 | assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -129,6 +129,10 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) { | |||
| 129 | 129 | assert.strictEqual(error.message, `connect ECONNREFUSED ::1:${port}`); | |
| 130 | 130 | } else if (error.code === 'EAFNOSUPPORT') { | |
| 131 | 131 | assert.strictEqual(error.message, `connect EAFNOSUPPORT ::1:${port} - Local (undefined:undefined)`); | |
| 132 | + } else if (common.isIBMi) { | ||
| 133 | + // IBMi returns EUNATCH (ERRNO 42) when IPv6 is disabled | ||
| 134 | + // keep this errno assertion until EUNATCH is recognized by libuv | ||
| 135 | + assert.strictEqual(error.errno, -42); | ||
| 132 | 136 | } else { | |
| 133 | 137 | assert.strictEqual(error.code, 'EADDRNOTAVAIL'); | |
| 134 | 138 | assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments