diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-09-29 19:05:08 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-06 19:44:42 +0200 |
commit | 5bb4542b0c93f9e9b57f388b8f191945d192dba3 (patch) | |
tree | ab096ad32be3ed9f083f360640393e25a653b911 /src/network/networkd-fdb.c | |
parent | network: drop list of bridge FDB entries (diff) | |
download | systemd-5bb4542b0c93f9e9b57f388b8f191945d192dba3.tar.xz systemd-5bb4542b0c93f9e9b57f388b8f191945d192dba3.zip |
network: move link_set_bridge_fdb()
Diffstat (limited to 'src/network/networkd-fdb.c')
-rw-r--r-- | src/network/networkd-fdb.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/network/networkd-fdb.c b/src/network/networkd-fdb.c index 0337ec24a5..792e02a066 100644 --- a/src/network/networkd-fdb.c +++ b/src/network/networkd-fdb.c @@ -122,7 +122,7 @@ static int set_fdb_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) } /* send a request to the kernel to add a FDB entry in its static MAC table. */ -int fdb_entry_configure(Link *link, FdbEntry *fdb_entry) { +static int fdb_entry_configure(Link *link, FdbEntry *fdb_entry) { _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL; int r; @@ -179,6 +179,22 @@ int fdb_entry_configure(Link *link, FdbEntry *fdb_entry) { return 1; } +int link_set_bridge_fdb(Link *link) { + FdbEntry *fdb_entry; + int r; + + assert(link); + assert(link->network); + + HASHMAP_FOREACH(fdb_entry, link->network->fdb_entries_by_section) { + r = fdb_entry_configure(link, fdb_entry); + if (r < 0) + return log_link_error_errno(link, r, "Failed to add MAC entry to static MAC table: %m"); + } + + return 0; +} + /* parse the HW address from config files. */ int config_parse_fdb_hwaddr( const char *unit, |