Conversation
Commit f9c0103 (WSL2 mirrored-mode loopback) uses netlink funcs that were removed/wrapped by commit 00bf437. Signed-off-by: Rob Murray <[email protected]>
adae955 to
333cfa6
Compare
| } | ||
| if _, err := netlink.LinkByName("loopback0"); err != nil { | ||
| if _, err := nlwrap.LinkByName("loopback0"); err != nil { | ||
| if !errors.As(err, &netlink.LinkNotFoundError{}) { |
There was a problem hiding this comment.
Definitely not for this PR, but we could even consider that (internal) package to return errdefs types I guess (in this case a errdefs.NotFound).
There was a problem hiding this comment.
The nlwrap package currently only wraps the minimum number of vishvananda/netlink functions ... only some of the underlying functions can return ErrDumpInterrupted, and only the few of those we actually use are wrapped. Methods on nlwrap.Handle that don't have replacements in nlwrap end up as direct calls to the vishvananda/netlink method. The idea is that the caller doesn't need to care whether the specific method is wrapped.
If we wanted to modify error types, I think we'd need to wrap all of the Handle methods and their package-level equivalents (or all of the ones we use), and keep it all in-step with the netlink package. That sounds like a bit of a headache!
- What I did
Commit f9c0103 (WSL2 mirrored-mode loopback) uses netlink funcs that were removed/wrapped by commit 00bf437.
(The
vishvananda/netlinkimport was removed fromsetup_ip_tables_linux.go, but was still used in the merged WSL2 code.)- How I did it
Fix the merged code.
- How to verify it
It compiles.
- Description for the changelog