mirror of
https://github.com/vishvananda/netlink.git
synced 2026-04-22 15:17:08 +08:00
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:
committed by
Alessandro Boch
parent
6432fc0b51
commit
3ba4d26397
+1
-1
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user