chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a42c8b5
)
nspawn: no need to subscribe to netlink messages if we just want to execute one operation
author
Lennart Poettering
<lennart@poettering.net>
Thu, 13 Feb 2014 13:08:16 +0000
(14:08 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 13 Feb 2014 13:08:16 +0000
(14:08 +0100)
src/nspawn/nspawn.c
patch
|
blob
|
history
diff --git
a/src/nspawn/nspawn.c
b/src/nspawn/nspawn.c
index 9ce1fa9b49cd72fdcf4b683ba231ccd5fd862488..689592ed7332f9b30bd04491c6ae0b26bdc5a6c6 100644
(file)
--- 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;
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;
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;
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;
}
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) {
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;
}
}
return r;
}
}