Merge pull request #25432 from containers/renovate/github.com-vishvananda-netlink-digest

fix(deps): update github.com/vishvananda/netlink digest to 0af3215
This commit is contained in:
openshift-merge-bot[bot] 2025-03-03 14:48:54 +00:00 committed by GitHub
commit 66427c7f09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 17 additions and 15 deletions

2
go.mod
View File

@ -69,7 +69,7 @@ require (
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.10.0
github.com/vbauerster/mpb/v8 v8.9.3
github.com/vishvananda/netlink v1.3.1-0.20250128002108-7c2350bd140f
github.com/vishvananda/netlink v1.3.1-0.20250221194427-0af32151e72b
go.etcd.io/bbolt v1.3.11
golang.org/x/crypto v0.33.0
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c

4
go.sum
View File

@ -517,8 +517,8 @@ github.com/vbatts/tar-split v0.12.1 h1:CqKoORW7BUWBe7UL/iqTVvkTBOF8UvOMKOIZykxnn
github.com/vbatts/tar-split v0.12.1/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA=
github.com/vbauerster/mpb/v8 v8.9.3 h1:PnMeF+sMvYv9u23l6DO6Q3+Mdj408mjLRXIzmUmU2Z8=
github.com/vbauerster/mpb/v8 v8.9.3/go.mod h1:hxS8Hz4C6ijnppDSIX6LjG8FYJSoPo9iIOcE53Zik0c=
github.com/vishvananda/netlink v1.3.1-0.20250128002108-7c2350bd140f h1:G5t3qYQ3YL2zMn2kFzRYIPk1EvDvMNV9pP+w+39VtzI=
github.com/vishvananda/netlink v1.3.1-0.20250128002108-7c2350bd140f/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
github.com/vishvananda/netlink v1.3.1-0.20250221194427-0af32151e72b h1:hYWtmuzlR0jpWu+ljWfPMi7oNiZ9x/D3GbBqgZTOhyI=
github.com/vishvananda/netlink v1.3.1-0.20250221194427-0af32151e72b/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=

View File

@ -5,8 +5,8 @@ import (
"encoding/binary"
"errors"
"fmt"
"io/fs"
"net"
"strings"
"time"
"github.com/vishvananda/netlink/nl"
@ -159,7 +159,7 @@ func (h *Handle) ConntrackDeleteFilter(table ConntrackTableType, family InetFami
// ConntrackDeleteFilters deletes entries on the specified table matching any of the specified filters using the netlink handle passed
// conntrack -D [table] parameters Delete conntrack or expectation
func (h *Handle) ConntrackDeleteFilters(table ConntrackTableType, family InetFamily, filters ...CustomConntrackFilter) (uint, error) {
var errMsgs []string
var finalErr error
res, err := h.dumpConntrackTable(table, family)
if err != nil {
if !errors.Is(err, ErrDumpInterrupted) {
@ -167,9 +167,10 @@ func (h *Handle) ConntrackDeleteFilters(table ConntrackTableType, family InetFam
}
// This allows us to at least do a best effort to try to clean the
// entries matching the filter.
errMsgs = append(errMsgs, err.Error())
finalErr = err
}
var totalFilterErrors int
var matched uint
for _, dataRaw := range res {
flow := parseRawData(dataRaw)
@ -178,19 +179,20 @@ func (h *Handle) ConntrackDeleteFilters(table ConntrackTableType, family InetFam
req2 := h.newConntrackRequest(table, family, nl.IPCTNL_MSG_CT_DELETE, unix.NLM_F_ACK)
// skip the first 4 byte that are the netfilter header, the newConntrackRequest is adding it already
req2.AddRawData(dataRaw[4:])
if _, err = req2.Execute(unix.NETLINK_NETFILTER, 0); err == nil {
if _, err = req2.Execute(unix.NETLINK_NETFILTER, 0); err == nil || errors.Is(err, fs.ErrNotExist) {
matched++
// flow is already deleted, no need to match on other filters and continue to the next flow.
break
} else {
totalFilterErrors++
}
errMsgs = append(errMsgs, fmt.Sprintf("failed to delete conntrack flow '%s': %s", flow.String(), err.Error()))
}
}
}
if len(errMsgs) > 0 {
return matched, fmt.Errorf(strings.Join(errMsgs, "; "))
if totalFilterErrors > 0 {
finalErr = errors.Join(finalErr, fmt.Errorf("failed to delete %d conntrack flows with %d filters", totalFilterErrors, len(filters)))
}
return matched, nil
return matched, finalErr
}
func (h *Handle) newConntrackRequest(table ConntrackTableType, family InetFamily, operation, flags int) *nl.NetlinkRequest {

View File

@ -2821,7 +2821,7 @@ func parseVxlanData(link Link, data []syscall.NetlinkRouteAttr) {
case nl.IFLA_VXLAN_PORT_RANGE:
buf := bytes.NewBuffer(datum.Value[0:4])
var pr vxlanPortRange
if binary.Read(buf, binary.BigEndian, &pr) != nil {
if binary.Read(buf, binary.BigEndian, &pr) == nil {
vxlan.PortLow = int(pr.Lo)
vxlan.PortHigh = int(pr.Hi)
}

View File

@ -17,7 +17,7 @@ func ParseAttributes(data []byte) <-chan Attribute {
go func() {
i := 0
for i+4 < len(data) {
for i+4 <= len(data) {
length := int(native.Uint16(data[i : i+2]))
attrType := native.Uint16(data[i+2 : i+4])

View File

@ -500,7 +500,7 @@ func (h *Handle) UnixSocketDiagInfo() ([]*UnixDiagInfoResp, error) {
var attrs []syscall.NetlinkRouteAttr
var err error
if attrs, err = nl.ParseRouteAttr(msg[sizeofSocket:]); err != nil {
if attrs, err = nl.ParseRouteAttr(msg[sizeofUnixSocket:]); err != nil {
return false
}

2
vendor/modules.txt vendored
View File

@ -1116,7 +1116,7 @@ github.com/vbauerster/mpb/v8
github.com/vbauerster/mpb/v8/cwriter
github.com/vbauerster/mpb/v8/decor
github.com/vbauerster/mpb/v8/internal
# github.com/vishvananda/netlink v1.3.1-0.20250128002108-7c2350bd140f
# github.com/vishvananda/netlink v1.3.1-0.20250221194427-0af32151e72b
## explicit; go 1.12
github.com/vishvananda/netlink
github.com/vishvananda/netlink/nl