]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #8623 from yuwata/resolvectl
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 19 Apr 2018 10:33:05 +0000 (12:33 +0200)
committerGitHub <noreply@github.com>
Thu, 19 Apr 2018 10:33:05 +0000 (12:33 +0200)
resolvectl: rename systemd-resolve to resolvectl

1  2 
src/resolve/resolvconf-compat.c

index 1342e7b1f4dffcb1379acc94e086e63ebe9013c8,94a163324868e3678f0b2161463d75822a35cf5d..a6b327e2f0ee466b3b4201cbb7ccad151c27d6aa
@@@ -10,7 -10,7 +10,7 @@@
  #include "fileio.h"
  #include "parse-util.h"
  #include "resolvconf-compat.h"
- #include "resolve-tool.h"
+ #include "resolvectl.h"
  #include "resolved-def.h"
  #include "string-util.h"
  #include "strv.h"
@@@ -44,8 -44,6 +44,6 @@@ static int parse_nameserver(const char 
  
          for (;;) {
                  _cleanup_free_ char *word = NULL;
-                 struct in_addr_data data, *n;
-                 int ifindex = 0;
  
                  r = extract_first_word(&string, &word, NULL, 0);
                  if (r < 0)
                  if (r == 0)
                          break;
  
-                 r = in_addr_ifindex_from_string_auto(word, &data.family, &data.address, &ifindex);
-                 if (r < 0)
-                         return log_error_errno(r, "Failed to parse name server '%s': %m", word);
-                 if (ifindex > 0 && ifindex != arg_ifindex) {
-                         log_error("Name server interface '%s' does not match selected interface: %m", word);
-                         return -EINVAL;
-                 }
-                 /* Some superficial filtering */
-                 if (in_addr_is_null(data.family, &data.address))
-                         continue;
-                 if (data.family == AF_INET && data.address.in.s_addr == htobe32(INADDR_DNS_STUB)) /* resolved's own stub? */
-                         continue;
-                 n = reallocarray(arg_set_dns, arg_n_set_dns + 1, sizeof(struct in_addr_data));
-                 if (!n)
+                 if (strv_push(&arg_set_dns, word) < 0)
                          return log_oom();
-                 arg_set_dns = n;
-                 arg_set_dns[arg_n_set_dns++] = data;
          }
  
          return 0;
@@@ -93,14 -72,6 +72,6 @@@ static int parse_search_domain(const ch
                  if (r == 0)
                          break;
  
-                 r = dns_name_is_valid(word);
-                 if (r < 0)
-                         return log_error_errno(r, "Failed to validate specified domain '%s': %m", word);
-                 if (r == 0) {
-                         log_error("Domain not valid: %s", word);
-                         return -EINVAL;
-                 }
                  if (strv_push(&arg_set_domain, word) < 0)
                          return log_oom();
  
@@@ -130,6 -101,7 +101,6 @@@ int resolvconf_parse_argv(int argc, cha
                  {}
          };
  
 -
          enum {
                  TYPE_REGULAR,
                  TYPE_PRIVATE,   /* -p: Not supported, treated identically to TYPE_REGULAR */
                  }
  
                  arg_ifindex = ifi;
+                 arg_ifname = iface;
          }
  
          if (arg_mode == MODE_SET_LINK) {
                  } else if (type == TYPE_PRIVATE)
                          log_debug("Private DNS server data not supported, ignoring.");
  
-                 if (arg_n_set_dns == 0) {
+                 if (!arg_set_dns) {
                          log_error("No DNS servers specified, refusing operation.");
                          return -EINVAL;
                  }