selftests: forwarding: lib: Extract trap_{, un}install()
authorPetr Machata <petrm@mellanox.com>
Thu, 24 May 2018 14:27:35 +0000 (16:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 May 2018 02:26:19 +0000 (22:26 -0400)
commit87c0c046e80293af001af95a66c46491ee43130a
treea00995d0755bc1dcb78605b344bbefb5264be48a
parent1893150fd531a1dfacef36e4f43be6cc795c6f50
selftests: forwarding: lib: Extract trap_{, un}install()

A mirror-to-vlan test that's coming next needs to install the trap
unconditionally. Therefore extract from slow_path_trap_{,un}install()
a more generic functions trap_install() and trap_uninstall(), and covert
the former two to conditional wrappers around these.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/lib.sh