summaryrefslogtreecommitdiff
path: root/src/network/networkd-fdb.c
diff options
context:
space:
mode:
authorTobias Jungel <Tobias.Jungel@gmail.com>2016-10-05 17:06:40 +0200
committerLennart Poettering <lennart@poettering.net>2016-10-05 17:06:40 +0200
commitf6bb7ac5c6a200eb444f7f7ad043c01b2afa7d4c (patch)
treeeb2e80ffffc95be655c1acee67a92cc2fb5521bc /src/network/networkd-fdb.c
parent110b7e909aa36d7e83ece76e18a99aa89de00c28 (diff)
networkd: use BridgeFDB as well on bridge ports (#4253)
[BridgeFDB] did not apply to bridge ports so far. This patch adds the proper handling. In case of a bridge interface the correct flag NTF_MASTER is now set in the netlink call. FDB MAC addresses are now applied in link_enter_set_addresses to make sure the link is setup.
Diffstat (limited to 'src/network/networkd-fdb.c')
-rw-r--r--src/network/networkd-fdb.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/network/networkd-fdb.c b/src/network/networkd-fdb.c
index be8aebee2d..ed5a47589e 100644
--- a/src/network/networkd-fdb.c
+++ b/src/network/networkd-fdb.c
@@ -107,20 +107,28 @@ int fdb_entry_configure(Link *link, FdbEntry *fdb_entry) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
sd_netlink *rtnl;
int r;
+ uint8_t flags;
+ Bridge *bridge;
assert(link);
+ assert(link->network);
assert(link->manager);
assert(fdb_entry);
rtnl = link->manager->rtnl;
+ bridge = BRIDGE(link->network->bridge);
/* create new RTM message */
r = sd_rtnl_message_new_neigh(rtnl, &req, RTM_NEWNEIGH, link->ifindex, PF_BRIDGE);
if (r < 0)
return rtnl_log_create_error(r);
- /* only NTF_SELF flag supported. */
- r = sd_rtnl_message_neigh_set_flags(req, NTF_SELF);
+ if (bridge)
+ flags = NTF_MASTER;
+ else
+ flags = NTF_SELF;
+
+ r = sd_rtnl_message_neigh_set_flags(req, flags);
if (r < 0)
return rtnl_log_create_error(r);