mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
networkd: refuse IPv6 RADV prefixes that lack Prefix= setting
Fixes: #9589
This commit is contained in:
parent
b806f0b0aa
commit
59ea6e57a5
@ -503,6 +503,10 @@ _public_ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, int dynamic) {
|
||||
if (!p)
|
||||
return -EINVAL;
|
||||
|
||||
/* Refuse prefixes that don't have a prefix set */
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&p->opt.in6_addr))
|
||||
return -ENOEXEC;
|
||||
|
||||
LIST_FOREACH(prefix, cur, ra->prefixes) {
|
||||
|
||||
r = in_addr_prefix_intersect(AF_INET6,
|
||||
|
@ -494,9 +494,16 @@ int radv_configure(Link *link) {
|
||||
if (IN_SET(link->network->router_prefix_delegation,
|
||||
RADV_PREFIX_DELEGATION_STATIC,
|
||||
RADV_PREFIX_DELEGATION_BOTH)) {
|
||||
|
||||
LIST_FOREACH(prefixes, p, link->network->static_prefixes) {
|
||||
r = sd_radv_add_prefix(link->radv, p->radv_prefix, false);
|
||||
if (r != -EEXIST && r < 0)
|
||||
if (r == -EEXIST)
|
||||
continue;
|
||||
if (r == -ENOEXEC) {
|
||||
log_link_warning_errno(link, r, "[IPv6Prefix] section configured without Prefix= setting, ignoring section.");
|
||||
continue;
|
||||
}
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user