summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-10 20:54:10 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-10 23:26:53 +0200
commit04b764bf76a74943ca652691cfd5b511ed8fe96c (patch)
tree59d7eeb66770f89e9465d160fa41fed4d51f1882 /src/resolve/resolved-bus.c
parentba35662fbdde7b90aed6b34c641b4ff0ea740c68 (diff)
resolved: move verification that link is unmanaged into the proper bus calls
Previously, we checked only for the various SetLinkXYZ() calls on the Manager object exposed on the bus if the specified interface is managed/unmanaged by networkd (as we don't permit overriding DNS configuration via bus calls if networkd owns the device), but the equivalent SetXYZ() calls on the Link object did not have such a check. Fix that by moving the appropriate check into the latter, as the former just calls that anyway.
Diffstat (limited to 'src/resolve/resolved-bus.c')
-rw-r--r--src/resolve/resolved-bus.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c
index a72a03cfad..6d86cbf123 100644
--- a/src/resolve/resolved-bus.c
+++ b/src/resolve/resolved-bus.c
@@ -1442,26 +1442,6 @@ static int get_any_link(Manager *m, int ifindex, Link **ret, sd_bus_error *error
return 0;
}
-static int get_unmanaged_link(Manager *m, int ifindex, Link **ret, sd_bus_error *error) {
- Link *l;
- int r;
-
- assert(m);
- assert(ret);
-
- r = get_any_link(m, ifindex, &l, error);
- if (r < 0)
- return r;
-
- if (l->flags & IFF_LOOPBACK)
- return sd_bus_error_setf(error, BUS_ERROR_LINK_BUSY, "Link %s is loopback device.", l->name);
- if (l->is_managed)
- return sd_bus_error_setf(error, BUS_ERROR_LINK_BUSY, "Link %s is managed.", l->name);
-
- *ret = l;
- return 0;
-}
-
static int call_link_method(Manager *m, sd_bus_message *message, sd_bus_message_handler_t handler, sd_bus_error *error) {
int ifindex, r;
Link *l;
@@ -1475,7 +1455,7 @@ static int call_link_method(Manager *m, sd_bus_message *message, sd_bus_message_
if (r < 0)
return r;
- r = get_unmanaged_link(m, ifindex, &l, error);
+ r = get_any_link(m, ifindex, &l, error);
if (r < 0)
return r;