From 91befa9573c1155e731ed1fea8e3c3b85ba1db32 Mon Sep 17 00:00:00 2001 From: Linus Miller Date: Wed, 28 Jun 2023 10:31:11 +0200 Subject: [PATCH] Do not normalize cidr - Fix #48 --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7ae59d2..aa1fb0c 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,13 @@ import {networkInterfaces} from 'node:os'; import {gateway4async, gateway4sync, gateway6async, gateway6sync} from 'default-gateway'; -import {contains, normalize} from 'cidr-tools'; +import {contains} from 'cidr-tools'; function findIp({gateway}) { // Look for the matching interface in all local interfaces for (const addresses of Object.values(networkInterfaces())) { for (const {cidr} of addresses) { if (contains(cidr, gateway)) { - return normalize(cidr).split('/')[0]; + return cidr.split('/')[0]; } } }