summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-13 14:08:16 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-13 14:08:16 +0100
commitb88eb17a7a9aad8287df275c46c1d09b1aee09fd (patch)
tree50886de4b4e929c0889ad0dd13b1d084f2b38f47
parenta42c8b54b1619078c02f5e439bd2564c6d0f901f (diff)
nspawn: no need to subscribe to netlink messages if we just want to execute one operation
-rw-r--r--src/nspawn/nspawn.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 9ce1fa9b49..689592ed73 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1265,7 +1265,7 @@ static int move_network_interfaces(pid_t pid) {
if (strv_isempty(arg_network_interfaces))
return 0;
- r = sd_rtnl_open(NETLINK_ROUTE, &rtnl);
+ r = sd_rtnl_open(0, &rtnl);
if (r < 0) {
log_error("Failed to connect to netlink: %s", strerror(-r));
return r;
@@ -1273,10 +1273,10 @@ static int move_network_interfaces(pid_t pid) {
STRV_FOREACH(i, arg_network_interfaces) {
_cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
- unsigned ifi;
+ int ifi;
- ifi = if_nametoindex(*i);
- if (ifi == 0) {
+ ifi = (int) if_nametoindex(*i);
+ if (ifi <= 0) {
log_error("Failed to resolve interface %s: %m", *i);
return -errno;
}
@@ -1295,7 +1295,7 @@ static int move_network_interfaces(pid_t pid) {
r = sd_rtnl_call(rtnl, m, 0, NULL);
if (r < 0) {
- log_error("Failed to move interface to namespace: %s", strerror(-r));
+ log_error("Failed to move interface %s to namespace: %s", *i, strerror(-r));
return r;
}
}