diff --git a/go.mod b/go.mod index 795e8726a1b..fb6b9307398 100644 --- a/go.mod +++ b/go.mod @@ -34,12 +34,12 @@ require ( github.com/prometheus/procfs v0.15.1 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.1 - github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace + github.com/spf13/pflag v1.0.6-0.20250109003754-5ca813443bd2 github.com/spf13/viper v1.19.0 - github.com/sryoya/protorand v0.0.0-20240429201223-e7440656b2a4 + github.com/sryoya/protorand v0.0.0-20250114120907-8c1a8e3138f2 github.com/stretchr/testify v1.10.0 github.com/tidwall/gjson v1.18.0 - github.com/vishvananda/netlink v1.3.1-0.20241227191253-26ee0e2abe2d + github.com/vishvananda/netlink v1.3.1-0.20250116180449-56a588b0cd59 go.uber.org/atomic v1.11.0 go.uber.org/multierr v1.11.0 golang.org/x/sync v0.10.0 diff --git a/go.sum b/go.sum index 08eb30df952..04baa842b7f 100644 --- a/go.sum +++ b/go.sum @@ -361,12 +361,12 @@ github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cA github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace h1:9PNP1jnUjRhfmGMlkXHjYPishpcw4jpSt/V/xYY3FMA= -github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.6-0.20250109003754-5ca813443bd2 h1:VXx/BSJSJC/DjbDkZMZw8MhF9at8Rxo5I0PrDA5Bui4= +github.com/spf13/pflag v1.0.6-0.20250109003754-5ca813443bd2/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= -github.com/sryoya/protorand v0.0.0-20240429201223-e7440656b2a4 h1:/jKH9ivHOUkahZs3zPfJfOmkXDFB6OdsHZ4W8gyDb/c= -github.com/sryoya/protorand v0.0.0-20240429201223-e7440656b2a4/go.mod h1:9a23nlv6vzBeVlQq6JQCjljZ6sfzsB6aha1m5Ly1W2Y= +github.com/sryoya/protorand v0.0.0-20250114120907-8c1a8e3138f2 h1:AG8FApn4FCcByk6/r3QhXd6pzotkM8osGP+cGWpGlko= +github.com/sryoya/protorand v0.0.0-20250114120907-8c1a8e3138f2/go.mod h1:9a23nlv6vzBeVlQq6JQCjljZ6sfzsB6aha1m5Ly1W2Y= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -391,8 +391,8 @@ github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/vishvananda/netlink v1.3.1-0.20241227191253-26ee0e2abe2d h1:aho1TDN+owyRC4gMe3PRewg0yBVdBsMg5kO9PYvzjo8= -github.com/vishvananda/netlink v1.3.1-0.20241227191253-26ee0e2abe2d/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs= +github.com/vishvananda/netlink v1.3.1-0.20250116180449-56a588b0cd59 h1:clQhS9WKlUC4G7m0+CKaZqu7FGY+jNZEFdq/7byjBMg= +github.com/vishvananda/netlink v1.3.1-0.20250116180449-56a588b0cd59/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs= github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY= github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= diff --git a/vendor/github.com/spf13/pflag/.editorconfig b/vendor/github.com/spf13/pflag/.editorconfig new file mode 100644 index 00000000000..4492e9f9fe1 --- /dev/null +++ b/vendor/github.com/spf13/pflag/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.go] +indent_style = tab diff --git a/vendor/github.com/spf13/pflag/.golangci.yaml b/vendor/github.com/spf13/pflag/.golangci.yaml new file mode 100644 index 00000000000..b274f248451 --- /dev/null +++ b/vendor/github.com/spf13/pflag/.golangci.yaml @@ -0,0 +1,4 @@ +linters: + disable-all: true + enable: + - nolintlint diff --git a/vendor/github.com/sryoya/protorand/rand.go b/vendor/github.com/sryoya/protorand/rand.go index be8c71246fa..89b4ff3434a 100644 --- a/vendor/github.com/sryoya/protorand/rand.go +++ b/vendor/github.com/sryoya/protorand/rand.go @@ -13,10 +13,8 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" ) -var ( - // Chars is the set of characters used to generate random strings. - Chars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") -) +// Chars is the set of characters used to generate random strings. +var Chars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") // ProtoRand is a source of random values for protobuf fields. type ProtoRand struct { @@ -286,7 +284,7 @@ func (p *ProtoRand) chooseEnumValueRandomly(values protoreflect.EnumValueDescrip return 0 } - value := values.Get(p.rand.Intn(ln - 1)) + value := values.Get(p.rand.Intn(ln)) return value.Number() } @@ -295,6 +293,6 @@ func (p *ProtoRand) chooseOneOfFieldRandomly(oneOf protoreflect.OneofDescriptor) if ln == 1 { return oneOf.Fields().Get(0) } - index := p.rand.Intn(ln - 1) + index := p.rand.Intn(ln) return oneOf.Fields().Get(index) } diff --git a/vendor/github.com/vishvananda/netlink/addr_linux.go b/vendor/github.com/vishvananda/netlink/addr_linux.go index 9b49baf9769..01c2306cb28 100644 --- a/vendor/github.com/vishvananda/netlink/addr_linux.go +++ b/vendor/github.com/vishvananda/netlink/addr_linux.go @@ -18,6 +18,7 @@ import ( // // If `addr` is an IPv4 address and the broadcast address is not given, it // will be automatically computed based on the IP mask if /30 or larger. +// If `net.IPv4zero` is given as the broadcast address, broadcast is disabled. func AddrAdd(link Link, addr *Addr) error { return pkgHandle.AddrAdd(link, addr) } @@ -28,6 +29,7 @@ func AddrAdd(link Link, addr *Addr) error { // // If `addr` is an IPv4 address and the broadcast address is not given, it // will be automatically computed based on the IP mask if /30 or larger. +// If `net.IPv4zero` is given as the broadcast address, broadcast is disabled. func (h *Handle) AddrAdd(link Link, addr *Addr) error { req := h.newNetlinkRequest(unix.RTM_NEWADDR, unix.NLM_F_CREATE|unix.NLM_F_EXCL|unix.NLM_F_ACK) return h.addrHandle(link, addr, req) @@ -39,6 +41,7 @@ func (h *Handle) AddrAdd(link Link, addr *Addr) error { // // If `addr` is an IPv4 address and the broadcast address is not given, it // will be automatically computed based on the IP mask if /30 or larger. +// If `net.IPv4zero` is given as the broadcast address, broadcast is disabled. func AddrReplace(link Link, addr *Addr) error { return pkgHandle.AddrReplace(link, addr) } @@ -49,6 +52,7 @@ func AddrReplace(link Link, addr *Addr) error { // // If `addr` is an IPv4 address and the broadcast address is not given, it // will be automatically computed based on the IP mask if /30 or larger. +// If `net.IPv4zero` is given as the broadcast address, broadcast is disabled. func (h *Handle) AddrReplace(link Link, addr *Addr) error { req := h.newNetlinkRequest(unix.RTM_NEWADDR, unix.NLM_F_CREATE|unix.NLM_F_REPLACE|unix.NLM_F_ACK) return h.addrHandle(link, addr, req) @@ -57,18 +61,13 @@ func (h *Handle) AddrReplace(link Link, addr *Addr) error { // AddrDel will delete an IP address from a link device. // // Equivalent to: `ip addr del $addr dev $link` -// -// If `addr` is an IPv4 address and the broadcast address is not given, it -// will be automatically computed based on the IP mask if /30 or larger. func AddrDel(link Link, addr *Addr) error { return pkgHandle.AddrDel(link, addr) } // AddrDel will delete an IP address from a link device. -// Equivalent to: `ip addr del $addr dev $link` // -// If `addr` is an IPv4 address and the broadcast address is not given, it -// will be automatically computed based on the IP mask if /30 or larger. +// Equivalent to: `ip addr del $addr dev $link` func (h *Handle) AddrDel(link Link, addr *Addr) error { req := h.newNetlinkRequest(unix.RTM_DELADDR, unix.NLM_F_ACK) return h.addrHandle(link, addr, req) @@ -142,6 +141,10 @@ func (h *Handle) addrHandle(link Link, addr *Addr, req *nl.NetlinkRequest) error addr.Broadcast = calcBroadcast } + if net.IPv4zero.Equal(addr.Broadcast) { + addr.Broadcast = nil + } + if addr.Broadcast != nil { req.AddData(nl.NewRtAttr(unix.IFA_BROADCAST, addr.Broadcast)) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 7f7db5404cf..2a4c0a5ec71 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -495,7 +495,7 @@ github.com/spf13/cast ## explicit; go 1.15 github.com/spf13/cobra github.com/spf13/cobra/doc -# github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace +# github.com/spf13/pflag v1.0.6-0.20250109003754-5ca813443bd2 ## explicit; go 1.12 github.com/spf13/pflag # github.com/spf13/viper v1.19.0 @@ -510,7 +510,7 @@ github.com/spf13/viper/internal/encoding/json github.com/spf13/viper/internal/encoding/toml github.com/spf13/viper/internal/encoding/yaml github.com/spf13/viper/internal/features -# github.com/sryoya/protorand v0.0.0-20240429201223-e7440656b2a4 +# github.com/sryoya/protorand v0.0.0-20250114120907-8c1a8e3138f2 ## explicit; go 1.17 github.com/sryoya/protorand # github.com/stoewer/go-strcase v1.3.0 @@ -534,7 +534,7 @@ github.com/tidwall/match # github.com/tidwall/pretty v1.2.0 ## explicit; go 1.16 github.com/tidwall/pretty -# github.com/vishvananda/netlink v1.3.1-0.20241227191253-26ee0e2abe2d +# github.com/vishvananda/netlink v1.3.1-0.20250116180449-56a588b0cd59 ## explicit; go 1.12 github.com/vishvananda/netlink github.com/vishvananda/netlink/nl