]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: move link_set_bridge_fdb()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Sep 2020 17:05:08 +0000 (02:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Oct 2020 17:44:42 +0000 (02:44 +0900)
src/network/networkd-fdb.c
src/network/networkd-fdb.h
src/network/networkd-link.c

index 0337ec24a564837b238c065c366a7daa367768a7..792e02a066f00cd23274701498fc837da65dfdbc 100644 (file)
@@ -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,
index c6b5055f8e16fadcfa8ee1621ee75dc358effd44..faddcf604e0f884e1c953d6b8de7e48036d70556 100644 (file)
@@ -42,7 +42,8 @@ struct FdbEntry {
 };
 
 FdbEntry *fdb_entry_free(FdbEntry *fdb_entry);
-int fdb_entry_configure(Link *link, FdbEntry *fdb_entry);
+
+int link_set_bridge_fdb(Link *link);
 
 const char* fdb_ntf_flags_to_string(NeighborCacheEntryFlags i) _const_;
 NeighborCacheEntryFlags fdb_ntf_flags_from_string(const char *s) _pure_;
index c47bf75cdffd04f22036dd18f20e912fa3bcf641..2282749fa607d4a6cf5300894c2f831501e5ca8c 100644 (file)
@@ -1132,19 +1132,6 @@ void link_check_ready(Link *link) {
         return;
 }
 
-static int link_set_bridge_fdb(Link *link) {
-        FdbEntry *fdb_entry;
-        int r;
-
-        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;
-}
-
 static int static_address_ready_callback(Address *address) {
         Address *a;
         Link *link;