Lines Matching refs:mdb
18 BridgeMDB *bridge_mdb_free(BridgeMDB *mdb) { in bridge_mdb_free() argument
19 if (!mdb) in bridge_mdb_free()
22 if (mdb->network) { in bridge_mdb_free()
23 assert(mdb->section); in bridge_mdb_free()
24 hashmap_remove(mdb->network->bridge_mdb_entries_by_section, mdb->section); in bridge_mdb_free()
27 config_section_free(mdb->section); in bridge_mdb_free()
29 return mfree(mdb); in bridge_mdb_free()
42 _cleanup_(bridge_mdb_freep) BridgeMDB *mdb = NULL; in bridge_mdb_new_static()
55 mdb = hashmap_get(network->bridge_mdb_entries_by_section, n); in bridge_mdb_new_static()
56 if (mdb) { in bridge_mdb_new_static()
57 *ret = TAKE_PTR(mdb); in bridge_mdb_new_static()
65 mdb = new(BridgeMDB, 1); in bridge_mdb_new_static()
66 if (!mdb) in bridge_mdb_new_static()
70 *mdb = (BridgeMDB) { in bridge_mdb_new_static()
75 …p_ensure_put(&network->bridge_mdb_entries_by_section, &config_section_hash_ops, mdb->section, mdb); in bridge_mdb_new_static()
80 *ret = TAKE_PTR(mdb); in bridge_mdb_new_static()
112 static int bridge_mdb_configure(BridgeMDB *mdb, Link *link, Request *req) { in bridge_mdb_configure() argument
117 assert(mdb); in bridge_mdb_configure()
125 (void) in_addr_to_string(mdb->family, &mdb->group_addr, &a); in bridge_mdb_configure()
127 strna(a), mdb->vlan_id); in bridge_mdb_configure()
135 .vid = mdb->vlan_id, in bridge_mdb_configure()
138 switch (mdb->family) { in bridge_mdb_configure()
140 entry.addr.u.ip4 = mdb->group_addr.in.s_addr; in bridge_mdb_configure()
145 entry.addr.u.ip6 = mdb->group_addr.in6; in bridge_mdb_configure()
198 BridgeMDB *mdb = ASSERT_PTR(userdata); in bridge_mdb_process_request() local
207 r = bridge_mdb_configure(mdb, link, req); in bridge_mdb_process_request()
215 BridgeMDB *mdb; in link_request_static_bridge_mdb() local
229 HASHMAP_FOREACH(mdb, link->network->bridge_mdb_entries_by_section) { in link_request_static_bridge_mdb()
231 mdb, NULL, in link_request_static_bridge_mdb()
254 static int bridge_mdb_verify(BridgeMDB *mdb) { in bridge_mdb_verify() argument
255 if (section_is_invalid(mdb->section)) in bridge_mdb_verify()
258 if (mdb->family == AF_UNSPEC) in bridge_mdb_verify()
262 mdb->section->filename, mdb->section->line); in bridge_mdb_verify()
264 if (!in_addr_is_multicast(mdb->family, &mdb->group_addr)) in bridge_mdb_verify()
268 mdb->section->filename, mdb->section->line); in bridge_mdb_verify()
270 if (mdb->family == AF_INET) { in bridge_mdb_verify()
271 if (in4_addr_is_local_multicast(&mdb->group_addr.in)) in bridge_mdb_verify()
275 mdb->section->filename, mdb->section->line); in bridge_mdb_verify()
277 if (in6_addr_is_link_local_all_nodes(&mdb->group_addr.in6)) in bridge_mdb_verify()
281 mdb->section->filename, mdb->section->line); in bridge_mdb_verify()
288 BridgeMDB *mdb; in network_drop_invalid_bridge_mdb_entries() local
292 HASHMAP_FOREACH(mdb, network->bridge_mdb_entries_by_section) in network_drop_invalid_bridge_mdb_entries()
293 if (bridge_mdb_verify(mdb) < 0) in network_drop_invalid_bridge_mdb_entries()
294 bridge_mdb_free(mdb); in network_drop_invalid_bridge_mdb_entries()
310 _cleanup_(bridge_mdb_free_or_set_invalidp) BridgeMDB *mdb = NULL; in config_parse_mdb_vlan_id()
320 r = bridge_mdb_new_static(network, filename, section_line, &mdb); in config_parse_mdb_vlan_id()
326 rvalue, &mdb->vlan_id, userdata); in config_parse_mdb_vlan_id()
330 TAKE_PTR(mdb); in config_parse_mdb_vlan_id()
347 _cleanup_(bridge_mdb_free_or_set_invalidp) BridgeMDB *mdb = NULL; in config_parse_mdb_group_address()
357 r = bridge_mdb_new_static(network, filename, section_line, &mdb); in config_parse_mdb_group_address()
361 r = in_addr_from_string_auto(rvalue, &mdb->family, &mdb->group_addr); in config_parse_mdb_group_address()
367 TAKE_PTR(mdb); in config_parse_mdb_group_address()