summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorAlin Rauta <alin.rauta@intel.com>2014-12-17 07:35:36 -0800
committerTom Gundersen <teg@jklm.no>2014-12-18 15:28:16 +0100
commitb98b483bac585af754e8a22ea890db8486905d8a (patch)
treeed96bde5cfc2ab1670450427e27a722c3a920092 /src/network/networkd-link.c
parentc2551e7105051f40b2bf77a5c1ecb2e720d78d77 (diff)
networkd: add FDB support
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 08f724e127..341ae88ec1 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -656,6 +656,21 @@ int link_address_drop_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata)
return 1;
}
+static int link_set_bridge_fdb(const Link *const link) {
+ FdbEntry *fdb_entry;
+ int r = 0;
+
+ LIST_FOREACH(static_fdb_entries, fdb_entry, link->network->static_fdb_entries) {
+ r = fdb_entry_configure(link->manager->rtnl, fdb_entry, link->ifindex);
+ if(r < 0) {
+ log_link_error(link, "Failed to add MAC entry to static MAC table: %s", strerror(-r));
+ break;
+ }
+ }
+
+ return r;
+}
+
static int link_set_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
_cleanup_link_unref_ Link *link = userdata;
int r;
@@ -1147,6 +1162,10 @@ static int link_configure(Link *link) {
assert(link->network);
assert(link->state == LINK_STATE_PENDING);
+ r = link_set_bridge_fdb(link);
+ if (r < 0)
+ return r;
+
if (link_ipv4ll_enabled(link)) {
r = ipv4ll_configure(link);
if (r < 0)