[LTP] [PATCH v2 1/2] tst_netdevice: Add permissive macro for adding traffic filters
Martin Doucha
mdoucha@suse.cz
Wed May 15 15:44:29 CEST 2024
Add a permissive variant of the NETDEV_ADD_TRAFFIC_FILTER() macro
for tests which expect the command to fail.
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
Changes since v1: New patch
include/tst_netdevice.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/tst_netdevice.h b/include/tst_netdevice.h
index 8d40148a6..2394f9c7f 100644
--- a/include/tst_netdevice.h
+++ b/include/tst_netdevice.h
@@ -179,6 +179,11 @@ int tst_netdev_add_traffic_filter(const char *file, const int lineno,
tst_netdev_add_traffic_filter(__FILE__, __LINE__, 1, (ifname), \
(parent), (handle), (protocol), (priority), (f_kind), (config))
+#define NETDEV_ADD_TRAFFIC_FILTER_RET(ifname, parent, handle, protocol, \
+ priority, f_kind, config) \
+ tst_netdev_add_traffic_filter(__FILE__, __LINE__, 0, (ifname), \
+ (parent), (handle), (protocol), (priority), (f_kind), (config))
+
int tst_netdev_remove_traffic_filter(const char *file, const int lineno,
int strict, const char *ifname, unsigned int parent,
unsigned int handle, unsigned int protocol, unsigned int priority,
--
2.44.0
More information about the ltp
mailing list