fou, gtp: fix wrong variable in ErrDumpInterrupted check

FouList and GTPPDPList check `err` instead of `executeErr` in the
ErrDumpInterrupted guard. In both functions, `err` refers to an earlier
call (FouFamilyId / GenlFamilyGet) that already succeeded, so it is
always nil at this point. This means `!errors.Is(err,
ErrDumpInterrupted)` is always true, and any executeErr — including
ErrDumpInterrupted — causes the function to return nil results.

This is the same class of bug as the RouteListFiltered issue: results
collected from the dump are discarded on ErrDumpInterrupted instead of
being returned to the caller.

Fix by checking the correct variable.

Signed-off-by: Ihar Hrachyshka <ihrachyshka@nvidia.com>
Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ihar Hrachyshka
2026-02-25 10:06:19 -05:00
committed by Alessandro Boch
parent 6432fc0b51
commit 3ba4d26397
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ func (h *Handle) FouList(fam int) ([]Fou, error) {
req.AddRawData(raw)
msgs, executeErr := req.Execute(unix.NETLINK_GENERIC, 0)
if executeErr != nil && !errors.Is(err, ErrDumpInterrupted) {
if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
return nil, executeErr
}
+1 -1
View File
@@ -89,7 +89,7 @@ func (h *Handle) GTPPDPList() ([]*PDP, error) {
req := h.newNetlinkRequest(int(f.ID), unix.NLM_F_DUMP)
req.AddData(msg)
msgs, executeErr := req.Execute(unix.NETLINK_GENERIC, 0)
if executeErr != nil && !errors.Is(err, ErrDumpInterrupted) {
if executeErr != nil && !errors.Is(executeErr, ErrDumpInterrupted) {
return nil, executeErr
}
pdps, err := parsePDP(msgs)