]> asedeno.scripts.mit.edu Git - linux.git/commit
selftests: forwarding: lib: Extract interface-init functions
authorPetr Machata <petrm@mellanox.com>
Tue, 26 Jun 2018 00:08:00 +0000 (02:08 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Jun 2018 01:42:12 +0000 (10:42 +0900)
commit3368b22379d67a92b0da8f2a76a6f0764177601d
tree7e80b92226a9378457d840f0ae5c3c530f998b56
parenta66d62d84225e1c2debaa238cff07a7df86c5aa8
selftests: forwarding: lib: Extract interface-init functions

The function simple_if_init() does two things: it creates a VRF, then
moves an interface into this VRF and configures addresses. The latter
comes in handy when adding more interfaces into a VRF later on. The
situation is similar for simple_if_fini().

Therefore split the interface remastering and address de/initialization
logic to a new pair of helpers __simple_if_init() / __simple_if_fini(),
and defer to these helpers from simple_if_init() and simple_if_fini().

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