Commit Graph

3 Commits

Author SHA1 Message Date
4089679c07 pkt-loop-filter: Fix gratuitous ARP handling
The exception for gratuitous ARPs are only supposed to be for entries that
would otherwise be dropped due to the loop filtering logic. In addition, we
should record egress gratuitous ARPs and make sure they don't trigger the
exception when looping back (this is 'rule 4' of the openvswitch SLB
bonding logic).

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-07-14 23:45:01 +02:00
60ed7a8e8b pkt-loop-filter: Filter multicast traffic
This adds filtering of multicast traffic to the set of interfaces. The
filtering works by marking one of the interfaces as "primary" (which is
just the first interface name that is supplied on the command line) and
filtering everything with an all-ones destination MAC address if it's
coming in on any interface that's not the primary one.

To handle interfaces going down, we actually supply all the ifindexes to
the BPF program, and also install a tracing hook that listens to ifdown
events and switches the logic to the next ifindex in the sequence if the
primary one goes down. This is a bit rudimentary but should at least
provide basic filtering.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-06-14 17:43:35 +02:00
070715cf1c Add pkt-loop-filter example
Add an example to filter looping packets on (for instance) a bond
interface, by recording the egress MAC+VLAN and dropping any packets that
come in on other (related) interfaces with the same MAC+VLAN.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-05-20 14:53:14 +02:00