ux: avoid showing 169.254.* addresses
Massimo Melina committed
Aug 23, 2023 at 10:03 UTC
fb0c9ae6973a2a18635d444b24844373bb48145c
1 file changed
+1
src/listen.ts
+1
@@ -206,6 +206,7 @@ export function getIps() {
206
nets && !ignore.test(name)
207
&& v4first(onlyTruthy(nets.map(net => !net.internal && net.address)))[0] // for each interface we consider only 1 address
208
)).flat())
209
+ .filter((x,i,a) => a.length > 1 || !x.startsWith('169.254')) // 169.254 = dhcp failure on the interface, but keep it if it's our only one
210
211
function v4first(a: string[]) {
212
return _.sortBy(a, x => x.includes(':'))