-static bool enable_name_policy(void) {
- _cleanup_free_ char *line;
- char *w, *state;
- int r;
- size_t l;
-
- r = read_one_line_file("/proc/cmdline", &line);
- if (r < 0) {
- log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
- return true; /* something is very wrong, let's not make it worse */
- }
-
- FOREACH_WORD_QUOTED(w, l, line, state)
- if (strneq(w, "net.ifnames=0", l)) {
- log_info("Link name policy disabled on kernel commandline, ignoring.");
- return false;
- }
-
- return true;
-}
-