aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/ifupdown.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 382033038..abc6b5813 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -891,6 +891,8 @@ static struct interfaces_file_t *read_interfaces(const char *filename)
891 if (strcmp(first_word, "up") != 0 891 if (strcmp(first_word, "up") != 0
892 && strcmp(first_word, "down") != 0 892 && strcmp(first_word, "down") != 0
893 && strcmp(first_word, "pre-up") != 0 893 && strcmp(first_word, "pre-up") != 0
894 && strcmp(first_word, "pre-down") != 0
895 && strcmp(first_word, "post-up") != 0
894 && strcmp(first_word, "post-down") != 0 896 && strcmp(first_word, "post-down") != 0
895 ) { 897 ) {
896 int i; 898 int i;
@@ -987,6 +989,8 @@ static void set_environ(struct interface_defn_t *iface, const char *mode)
987 if (strcmp(iface->option[i].name, "up") == 0 989 if (strcmp(iface->option[i].name, "up") == 0
988 || strcmp(iface->option[i].name, "down") == 0 990 || strcmp(iface->option[i].name, "down") == 0
989 || strcmp(iface->option[i].name, "pre-up") == 0 991 || strcmp(iface->option[i].name, "pre-up") == 0
992 || strcmp(iface->option[i].name, "pre-down") == 0
993 || strcmp(iface->option[i].name, "post-up") == 0
990 || strcmp(iface->option[i].name, "post-down") == 0 994 || strcmp(iface->option[i].name, "post-down") == 0
991 ) { 995 ) {
992 continue; 996 continue;
@@ -1056,6 +1060,7 @@ static int iface_up(struct interface_defn_t *iface)
1056 if (!execute_all(iface, "pre-up")) return 0; 1060 if (!execute_all(iface, "pre-up")) return 0;
1057 if (!iface->method->up(iface, doit)) return 0; 1061 if (!iface->method->up(iface, doit)) return 0;
1058 if (!execute_all(iface, "up")) return 0; 1062 if (!execute_all(iface, "up")) return 0;
1063 if (!execute_all(iface, "post-up")) return 0;
1059 return 1; 1064 return 1;
1060} 1065}
1061 1066
@@ -1063,6 +1068,7 @@ static int iface_down(struct interface_defn_t *iface)
1063{ 1068{
1064 if (!iface->method->down(iface,check)) return -1; 1069 if (!iface->method->down(iface,check)) return -1;
1065 set_environ(iface, "stop"); 1070 set_environ(iface, "stop");
1071 if (!execute_all(iface, "pre-down")) return 0;
1066 if (!execute_all(iface, "down")) return 0; 1072 if (!execute_all(iface, "down")) return 0;
1067 if (!iface->method->down(iface, doit)) return 0; 1073 if (!iface->method->down(iface, doit)) return 0;
1068 if (!execute_all(iface, "post-down")) return 0; 1074 if (!execute_all(iface, "post-down")) return 0;