resolved-conf.c revision f2dacc96b25528ca1b0caca6364a69d656cf1569
97a9a944b5887e91042b019776c41d5dd74557aferikabele/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive This file is part of systemd.
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive Copyright 2014 Tom Gundersen <teg@jklm.no>
5a58787efeb02a1c3f06569d019ad81fd2efa06end systemd is free software; you can redistribute it and/or modify it
5a58787efeb02a1c3f06569d019ad81fd2efa06end under the terms of the GNU Lesser General Public License as published by
5a58787efeb02a1c3f06569d019ad81fd2efa06end the Free Software Foundation; either version 2.1 of the License, or
5a58787efeb02a1c3f06569d019ad81fd2efa06end (at your option) any later version.
5a58787efeb02a1c3f06569d019ad81fd2efa06end systemd is distributed in the hope that it will be useful, but
5a58787efeb02a1c3f06569d019ad81fd2efa06end WITHOUT ANY WARRANTY; without even the implied warranty of
5a58787efeb02a1c3f06569d019ad81fd2efa06end MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz Lesser General Public License for more details.
5a58787efeb02a1c3f06569d019ad81fd2efa06end You should have received a copy of the GNU Lesser General Public License
5a58787efeb02a1c3f06569d019ad81fd2efa06end along with systemd; If not, see <http://www.gnu.org/licenses/>.
e1e8390280254f7f0580d701e583f670643d4f3fnilgunint manager_parse_dns_server(Manager *m, DnsServerType type, const char *string) {
5a58787efeb02a1c3f06569d019ad81fd2efa06end first = type == DNS_SERVER_FALLBACK ? m->fallback_dns_servers : m->dns_servers;
9b6a3a558cc90ffdaa0b50bd02546ffec424ded7slive bool found = false;
f8396ed8364b56ec8adeaa49cac35a929758a29eslive if (r < 0) {
5a58787efeb02a1c3f06569d019ad81fd2efa06end log_warning("Ignoring invalid DNS address '%s'", buffer);
5a58787efeb02a1c3f06569d019ad81fd2efa06end /* Filter out duplicates */
4db28ee269aa06f7c6232e11cd01f58c3349af23noodl if (s->family == family && in_addr_equal(family, &s->address, &addr)) {
117c1f888a14e73cdd821dc6c23eb0411144a41cnd if (r < 0)
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick const char *unit,
4db28ee269aa06f7c6232e11cd01f58c3349af23noodl const char *filename,
5a58787efeb02a1c3f06569d019ad81fd2efa06end const char *section,
5a58787efeb02a1c3f06569d019ad81fd2efa06end const char *lvalue,
5a58787efeb02a1c3f06569d019ad81fd2efa06end const char *rvalue,
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd /* Empty assignment means clear the list */
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /* Otherwise add to the list */
97a9a944b5887e91042b019776c41d5dd74557aferikabele if (r < 0) {
ced7ef1f8c0df1805da0e87dbc5a1b6282910573nd log_syntax(unit, LOG_ERR, filename, line, -r, "Failed to parse DNS server string '%s'. Ignoring.", rvalue);
92510838f2eb125726e15c5eb4f7a23c7a0396e4slive /* If we have a manual setting, then we stop reading
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick const char *unit,
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick const char *filename,
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick const char *section,
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick const char *lvalue,
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick const char *rvalue,
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick if (r < 0) {
8a6d5edcb07aeccca7afba02a17dd6904d6b206ctrawick log_syntax(unit, LOG_ERR, filename, line, -r, "Failed to parse support level '%s'. Ignoring.", rvalue);
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd "Resolve\0",
e8d485701957d5c6de870111c112e168a894d49and false, m);