From 933332a6cbe08c1f407ebc56bc485fc7ecd8df80 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 23 Jul 2020 10:43:14 -0600 Subject: [PATCH] lifecycle: add pre-down/post-up to match debian ifupdown --- libifupdown/lifecycle.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libifupdown/lifecycle.c b/libifupdown/lifecycle.c index a40cae1..0312788 100644 --- a/libifupdown/lifecycle.c +++ b/libifupdown/lifecycle.c @@ -214,10 +214,16 @@ lif_lifecycle_run(const struct lif_execute_opts *opts, struct lif_interface *ifa if (!lif_lifecycle_run_phase(opts, iface, "up", lifname, up)) return false; + if (!lif_lifecycle_run_phase(opts, iface, "post-up", lifname, up)) + return false; + lif_state_upsert(state, lifname, iface); } else { + if (!lif_lifecycle_run_phase(opts, iface, "pre-down", lifname, up)) + return false; + if (!lif_lifecycle_run_phase(opts, iface, "down", lifname, up)) return false;