networkd-bridge.c revision 39032b87779323a244dd89f4832949d462b2ac68
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2013 Tom Gundersen <teg@jklm.no>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "networkd.h"
#include "net-util.h"
#include "path-util.h"
#include "conf-files.h"
#include "conf-parser.h"
#include "list.h"
if (!bridge)
return;
}
}
if (manager_should_reload(manager))
if (!bridge) {
return -ENOENT;
}
return 0;
}
return 0;
}
int r;
if (r < 0) {
"Could not allocate RTM_SETLINK message: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not append IFLA_MASTER attribute: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not send rtnetlink message: %s",
strerror(-r));
return r;
}
return 0;
}
/* join the links that were attempted to be joined befor the
* link was ready */
}
return 0;
}
int r;
r = sd_rtnl_message_get_errno(m);
if (r < 0) {
return 1;
}
else
return 1;
}
int r;
if (r < 0) {
"Could not allocate RTM_NEWLINK message: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not append IFLA_IFNAME attribute: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not open IFLA_LINKINFO container: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not append IFLA_INFO_KIND attribute: %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not close IFLA_LINKINFO container %s",
strerror(-r));
return r;
}
if (r < 0) {
"Could not send rtnetlink message: %s", strerror(-r));
return r;
}
return 0;
}
} else {
/* the bridge is not yet read, save this request for when it is*/
if (!cb)
return log_oom();
}
return 0;
}
if (!bridge)
return -ENOENT;
return -EEXIST;
return 0;
}
int r;
if (!file) {
return 0;
else
return errno;
}
if (!bridge)
return log_oom();
(void*) network_gperf_lookup, false, false, bridge);
if (r < 0) {
return r;
}
return 0;
}
return log_oom();
if (r < 0)
return r;
r = bridge_create(bridge);
if (r < 0)
return r;
return 0;
}
char **files, **f;
int r;
if (r < 0) {
return r;
}
STRV_FOREACH_BACKWARDS(f, files) {
r = bridge_load_one(manager, *f);
if (r < 0)
return r;
}
return 0;
}