mirror of
https://github.com/vishvananda/netlink
synced 2025-03-20 18:17:38 +00:00
Preserve results when NLM_F_DUMP_INTR is set
Similar to https://github.com/vishvananda/netlink/pull/1018, but for ConntrackDeleteFilters() Relates to https://github.com/kubernetes/kubernetes/issues/129562
This commit is contained in:
parent
86d2f69adc
commit
3642538757
@ -159,13 +159,18 @@ 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
|
||||
res, err := h.dumpConntrackTable(table, family)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
if !errors.Is(err, ErrDumpInterrupted) {
|
||||
return 0, err
|
||||
}
|
||||
// This allows us to at least do a best effort to try to clean the
|
||||
// entries matching the filter.
|
||||
errMsgs = append(errMsgs, err.Error())
|
||||
}
|
||||
|
||||
var matched uint
|
||||
var errMsgs []string
|
||||
for _, dataRaw := range res {
|
||||
flow := parseRawData(dataRaw)
|
||||
for _, filter := range filters {
|
||||
|
Loading…
Reference in New Issue
Block a user