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

network: refuse to configure NDISC twice

This commit is contained in:
Yu Watanabe 2021-04-10 13:37:35 +09:00 committed by Luca Boccassi
parent 1065501406
commit 5c078687dc

View File

@ -1315,7 +1315,9 @@ int ndisc_configure(Link *link) {
if (!link_ipv6_accept_ra_enabled(link))
return 0;
if (!link->ndisc) {
if (link->ndisc)
return 0; /* Already configured. */
r = sd_ndisc_new(&link->ndisc);
if (r < 0)
return r;
@ -1323,7 +1325,6 @@ int ndisc_configure(Link *link) {
r = sd_ndisc_attach_event(link->ndisc, link->manager->event, 0);
if (r < 0)
return r;
}
r = sd_ndisc_set_mac(link->ndisc, &link->hw_addr.addr.ether);
if (r < 0)