diff options
author | Alin Rauta <alin.rauta@intel.com> | 2014-12-17 07:35:36 -0800 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-12-18 15:28:16 +0100 |
commit | b98b483bac585af754e8a22ea890db8486905d8a (patch) | |
tree | ed96bde5cfc2ab1670450427e27a722c3a920092 /src/network/networkd-link.c | |
parent | c2551e7105051f40b2bf77a5c1ecb2e720d78d77 (diff) |
networkd: add FDB support
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 19 |
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) |