Commit Graph

3 Commits

Author SHA1 Message Date
fa72f26076 pkt-loop-filter: Reset err when falling back to INIT_NS
The previous commit working around missing SO_NETNS_COOKIE failed to reset
the err variable, which means things still failed.

Reported-by: Hangbin Liu <haliu@redhat.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-07-08 12:54:04 +02:00
e92fd14faf pkt-loop-filter: Support compiling without SO_NETNS_COOKIE
The SO_NETNS_COOKIE sockopt is fairly new; make sure we can compile the
program without it being defined, and fall back (with a warning) to just
always returning 1 as the netns cookie if the option doesn't work, which
should keep things working in the init namespace at least.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-07-07 01:05:28 +02:00
032d9cde85 pkt-loop-filter: Add get-bond-active utility
Add a small utility that uses a kprobe to extract the currently active
slave ifindex from a bond interface. This value is normally only exported
to userspace for bond types where it can be explicitly set, but the bond
driver has an internal notion of an active interface regardless of the bond
type. We can extract this value with a kprobe by attaching to a function in
the bond driver and triggering an operation that causes this function to be
called.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-06-29 16:58:34 +02:00