From 049cd883e8aaa45d37510b2d1292cdaf5ecaf9a6 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 6 May 2024 23:36:56 +0300 Subject: [PATCH 1/2] [support/network] Sort and deduplicate IPs --- CHANGELOG.md | 4 ++++ ek.go | 2 +- support/network/network.go | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aaf8305f..60d89f76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Changelog +### 12.123.1 + +- `[support/network]` Sort and deduplicate IPs + ### 12.123.0 - `[csv]` Added method `Reader.Line` diff --git a/ek.go b/ek.go index 225c6e11..6b9a176a 100644 --- a/ek.go +++ b/ek.go @@ -21,7 +21,7 @@ import ( // ////////////////////////////////////////////////////////////////////////////////// // // VERSION is current ek package version -const VERSION = "12.123.0" +const VERSION = "12.123.1" // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/network/network.go b/support/network/network.go index 5587527b..1a825034 100644 --- a/support/network/network.go +++ b/support/network/network.go @@ -16,6 +16,8 @@ import ( "github.com/essentialkaos/ek/v12/netutil" "github.com/essentialkaos/ek/v12/req" + "github.com/essentialkaos/ek/v12/sliceutil" + "github.com/essentialkaos/ek/v12/sortutil" "github.com/essentialkaos/ek/v12/support" ) @@ -29,6 +31,12 @@ func Collect(ipResolverURL ...string) *support.NetworkInfo { IPv6: cleanIPList(netutil.GetAllIP6()), } + sortutil.StringsNatural(info.IPv4) + sortutil.StringsNatural(info.IPv6) + + info.IPv4 = sliceutil.Deduplicate(info.IPv4) + info.IPv6 = sliceutil.Deduplicate(info.IPv6) + info.Hostname, _ = os.Hostname() if len(ipResolverURL) != 0 { From bdeea5200a83f9177aaa68d8c4808e5b629defee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 02:21:04 +0000 Subject: [PATCH 2/2] Bump golang.org/x/crypto from 0.22.0 to 0.23.0 Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/crypto/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 348d9711..22ede318 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/essentialkaos/check v1.4.0 github.com/essentialkaos/depsy v1.3.0 github.com/essentialkaos/go-linenoise/v3 v3.6.0 - golang.org/x/crypto v0.22.0 + golang.org/x/crypto v0.23.0 golang.org/x/sys v0.20.0 ) diff --git a/go.sum b/go.sum index 8dc19cd3..af360b53 100644 --- a/go.sum +++ b/go.sum @@ -13,7 +13,7 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=