1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

network: assume Scope=host when Address= is loopback address

Fixes #14903.
This commit is contained in:
Yu Watanabe 2020-02-28 02:10:15 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 96100b8a04
commit 07336a0672
2 changed files with 5 additions and 0 deletions

View File

@ -1053,6 +1053,7 @@ int config_parse_address_scope(const char *unit,
}
}
n->scope_set = true;
n = NULL;
return 0;
}
@ -1125,5 +1126,8 @@ int address_section_verify(Address *address) {
address->section->filename, address->section->line);
}
if (!address->scope_set && in_addr_is_localhost(address->family, &address->in_addr) > 0)
address->scope = RT_SCOPE_HOST;
return 0;
}

View File

@ -39,6 +39,7 @@ struct Address {
union in_addr_union in_addr;
union in_addr_union in_addr_peer;
bool scope_set:1;
bool ip_masquerade_done:1;
bool manage_temporary_address:1;
bool home_address:1;