1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

network: ignore requested ipv6 fdb entry when ipv6 is disabled by sysctl

This commit is contained in:
Yu Watanabe 2019-06-11 23:33:22 +09:00
parent 7ef7e5509b
commit b0ab85a2e4

View File

@ -124,6 +124,11 @@ int fdb_entry_configure(Link *link, FdbEntry *fdb_entry) {
assert(link->manager); assert(link->manager);
assert(fdb_entry); assert(fdb_entry);
if (fdb_entry->family == AF_INET6 && manager_sysctl_ipv6_enabled(link->manager) == 0) {
log_link_warning(link, "An IPv6 fdb entry is requested, but IPv6 is disabled by sysctl, ignoring.");
return 0;
}
/* create new RTM message */ /* create new RTM message */
r = sd_rtnl_message_new_neigh(link->manager->rtnl, &req, RTM_NEWNEIGH, link->ifindex, PF_BRIDGE); r = sd_rtnl_message_new_neigh(link->manager->rtnl, &req, RTM_NEWNEIGH, link->ifindex, PF_BRIDGE);
if (r < 0) if (r < 0)
@ -169,7 +174,7 @@ int fdb_entry_configure(Link *link, FdbEntry *fdb_entry) {
link_ref(link); link_ref(link);
return 0; return 1;
} }
/* remove and FDB entry. */ /* remove and FDB entry. */