evl/net: rx filter precedence over loopback
PATCH 1/1 evl/net: rx filter precedence over loopback
Signed-off-by Brandon Ho <[email protected]>
--- include/evl/net/device.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
include/evl/net/device.h +9 -8
@@ -53,18 +53,19 @@ evl_net_filter_rx(struct net_device *dev, struct sk_buff *skb)struct evl_netdev_state *est = dev->oob_state.estate;/* -* Unconditionally accept all traffic sent to oob-enabled -* loopback devices from the oob stage. Those devices are very -* unlikely to support VLANs, but we could still use a filter -* to accept in-band traffic, so keep on checking for the -* latter. +* RX filter takes precedence over loopback acceptance, because +* it may be used to route packets to in-band consumers. +*/ +if (test_bit (EVL_NETDEV_RX_FILTER_BIT , &est->flags)) +return __evl_net_filter_rx (est, skb); + +/* +* Accept all traffic sent to oob-enabled loopback devices +* from the oob stage. */ if (dev->flags &IFF_LOOPBACK &&running_oob ())return EVL_RX_ACCEPT ; -if (test_bit (EVL_NETDEV_RX_FILTER_BIT , &est->flags)) -return __evl_net_filter_rx (est, skb); -return EVL_RX_VLAN ; }
Signature · 1 line
2.43.0
Quoted 26 lines · Brandon Ho
Signed-off-by Brandon Ho <[email protected]>--- include/evl/net/device.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)include/evl/net/device.h +8
-5@@ -53,18 +53,19 @@ evl_net_filter_rx(struct net_device *dev, struct sk_buff *skb)struct evl_netdev_state *est = dev->oob_state.estate;/* -* Unconditionally accept all traffic sent to oob-enabled -* loopback devices from the oob stage. Those devices are very -* unlikely to support VLANs, but we could still use a filter -* to accept in-band traffic, so keep on checking for the -* latter. +* RX filter takes precedence over loopback acceptance, because +* it may be used to route packets to in-band consumers. +*/ +if (test_bit (EVL_NETDEV_RX_FILTER_BIT , &est->flags)) +return __evl_net_filter_rx (est, skb); + +/* +* Accept all traffic sent to oob-enabled loopback devices
include/evl/net/device.h evl_net_filter_rx(struct net_device *dev, struct sk_buff *skb) · line 70
Quoted 10 lines
include/evl/net/device.h +1
-3+* from the oob stage. */ if (dev->flags &IFF_LOOPBACK &&running_oob ())return EVL_RX_ACCEPT ; -if (test_bit (EVL_NETDEV_RX_FILTER_BIT , &est->flags)) -return __evl_net_filter_rx (est, skb); -return EVL_RX_VLAN ; }
Thanks for contributing, appreciated. The change above is superseded by the following (recent) commit:
https://gitlab.com/Xenomai/xenomai4/linux-evl/-/commit/0bf66e53dcf91da8b3a8c3283cb78ff17712c670
Signature · 1 line
Philippe.