chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
units: limit caps for bus proxyd and driverd services
[elogind.git]
/
src
/
network
/
networkd-bridge.c
diff --git
a/src/network/networkd-bridge.c
b/src/network/networkd-bridge.c
index 371c093ca12f4d805d763db664fd4c188299d8ad..f110b8aa12c770adb5937b23ef40223b5394a49d 100644
(file)
--- a/
src/network/networkd-bridge.c
+++ b/
src/network/networkd-bridge.c
@@
-84,14
+84,14
@@
static int bridge_join_ready(Bridge *bridge, Link* link, sd_rtnl_message_handler
assert(link);
assert(callback);
assert(link);
assert(callback);
- r = sd_rtnl_message_link_new(RTM_SETLINK, link->ifindex,
0, 0,
&req);
+ r = sd_rtnl_message_link_new(RTM_SETLINK, link->ifindex, &req);
if (r < 0) {
log_error("Could not allocate RTM_SETLINK message: %s",
strerror(-r));
return r;
}
if (r < 0) {
log_error("Could not allocate RTM_SETLINK message: %s",
strerror(-r));
return r;
}
- r = sd_rtnl_message_append
(req, IFLA_MASTER, &
bridge->link->ifindex);
+ r = sd_rtnl_message_append
_u32(req, IFLA_MASTER,
bridge->link->ifindex);
if (r < 0) {
log_error("Could not append IFLA_MASTER attribute: %s",
strerror(-r));
if (r < 0) {
log_error("Could not append IFLA_MASTER attribute: %s",
strerror(-r));
@@
-132,15
+132,17
@@
static int bridge_create_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userda
r = sd_rtnl_message_get_errno(m);
if (r < 0) {
log_warning("Bridge '%s' failed: %s", bridge->name, strerror(-r));
r = sd_rtnl_message_get_errno(m);
if (r < 0) {
log_warning("Bridge '%s' failed: %s", bridge->name, strerror(-r));
- return bridge_enter_failed(bridge);
+ bridge_enter_failed(bridge);
+
+ return 1;
}
if (bridge->link)
}
if (bridge->link)
-
return
bridge_enter_ready(bridge);
-
- bridge->state = BRIDGE_STATE_CREATED;
+ bridge_enter_ready(bridge);
+ else
+
bridge->state = BRIDGE_STATE_CREATED;
- return
0
;
+ return
1
;
}
static int bridge_create(Bridge *bridge) {
}
static int bridge_create(Bridge *bridge) {
@@
-153,14
+155,14
@@
static int bridge_create(Bridge *bridge) {
assert(bridge->manager);
assert(bridge->manager->rtnl);
assert(bridge->manager);
assert(bridge->manager->rtnl);
- r = sd_rtnl_message_link_new(RTM_NEWLINK, 0,
0, 0,
&req);
+ r = sd_rtnl_message_link_new(RTM_NEWLINK, 0, &req);
if (r < 0) {
log_error("Could not allocate RTM_NEWLINK message: %s",
strerror(-r));
return r;
}
if (r < 0) {
log_error("Could not allocate RTM_NEWLINK message: %s",
strerror(-r));
return r;
}
- r = sd_rtnl_message_append(req, IFLA_IFNAME, bridge->name);
+ r = sd_rtnl_message_append
_string
(req, IFLA_IFNAME, bridge->name);
if (r < 0) {
log_error("Could not append IFLA_IFNAME attribute: %s",
strerror(-r));
if (r < 0) {
log_error("Could not append IFLA_IFNAME attribute: %s",
strerror(-r));
@@
-174,7
+176,7
@@
static int bridge_create(Bridge *bridge) {
return r;
}
return r;
}
- r = sd_rtnl_message_append(req, IFLA_INFO_KIND, "bridge");
+ r = sd_rtnl_message_append
_string
(req, IFLA_INFO_KIND, "bridge");
if (r < 0) {
log_error("Could not append IFLA_INFO_KIND attribute: %s",
strerror(-r));
if (r < 0) {
log_error("Could not append IFLA_INFO_KIND attribute: %s",
strerror(-r));
@@
-202,8
+204,6
@@
static int bridge_create(Bridge *bridge) {
}
int bridge_join(Bridge *bridge, Link *link, sd_rtnl_message_handler_t callback) {
}
int bridge_join(Bridge *bridge, Link *link, sd_rtnl_message_handler_t callback) {
- _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
-
if (bridge->state == BRIDGE_STATE_READY) {
bridge_join_ready(bridge, link, callback);
} else {
if (bridge->state == BRIDGE_STATE_READY) {
bridge_join_ready(bridge, link, callback);
} else {
@@
-246,6
+246,9
@@
static int bridge_load_one(Manager *manager, const char *filename) {
_cleanup_fclose_ FILE *file = NULL;
int r;
_cleanup_fclose_ FILE *file = NULL;
int r;
+ assert(manager);
+ assert(filename);
+
file = fopen(filename, "re");
if (!file) {
if (errno == ENOENT)
file = fopen(filename, "re");
if (!file) {
if (errno == ENOENT)