diff options
-rw-r--r-- | networking/ifupdown.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 5481134e5..80fce87a6 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -1022,6 +1022,22 @@ static struct interfaces_file_t *read_interfaces(const char *filename, struct in | |||
1022 | currently_processing = NONE; | 1022 | currently_processing = NONE; |
1023 | } else if (strcmp(first_word, "source") == 0) { | 1023 | } else if (strcmp(first_word, "source") == 0) { |
1024 | read_interfaces(next_word(&rest_of_line), defn); | 1024 | read_interfaces(next_word(&rest_of_line), defn); |
1025 | } else if (is_prefixed_with(first_word, "source-dir")) { | ||
1026 | const char *dirpath; | ||
1027 | DIR *dir; | ||
1028 | struct dirent *entry; | ||
1029 | |||
1030 | dirpath = next_word(&rest_of_line); | ||
1031 | dir = xopendir(dirpath); | ||
1032 | while ((entry = readdir(dir)) != NULL) { | ||
1033 | char *path; | ||
1034 | if (entry->d_name[0] == '.') | ||
1035 | continue; | ||
1036 | path = concat_path_file(dirpath, entry->d_name); | ||
1037 | read_interfaces(path, defn); | ||
1038 | free(path); | ||
1039 | } | ||
1040 | closedir(dir); | ||
1025 | } else { | 1041 | } else { |
1026 | switch (currently_processing) { | 1042 | switch (currently_processing) { |
1027 | case IFACE: | 1043 | case IFACE: |