mirror of
https://github.com/vishvananda/netlink
synced 2025-04-01 22:58:37 +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
|
// 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
|
// conntrack -D [table] parameters Delete conntrack or expectation
|
||||||
func (h *Handle) ConntrackDeleteFilters(table ConntrackTableType, family InetFamily, filters ...CustomConntrackFilter) (uint, error) {
|
func (h *Handle) ConntrackDeleteFilters(table ConntrackTableType, family InetFamily, filters ...CustomConntrackFilter) (uint, error) {
|
||||||
|
var errMsgs []string
|
||||||
res, err := h.dumpConntrackTable(table, family)
|
res, err := h.dumpConntrackTable(table, family)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if !errors.Is(err, ErrDumpInterrupted) {
|
||||||
return 0, err
|
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 matched uint
|
||||||
var errMsgs []string
|
|
||||||
for _, dataRaw := range res {
|
for _, dataRaw := range res {
|
||||||
flow := parseRawData(dataRaw)
|
flow := parseRawData(dataRaw)
|
||||||
for _, filter := range filters {
|
for _, filter := range filters {
|
||||||
|
Loading…
Reference in New Issue
Block a user