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

networkd: don't try to configure IPv6 proxy NDP if IPv6 is not available (#7613)

Fixes: #7612
This commit is contained in:
Lennart Poettering 2017-12-13 05:47:10 +01:00 committed by Yu Watanabe
parent ffbae6c978
commit 18a121f9b4

View File

@ -29,6 +29,7 @@
#include "networkd-manager.h"
#include "networkd-network.h"
#include "string-util.h"
#include "socket-util.h"
static bool ipv6_proxy_ndp_is_needed(Link *link) {
assert(link);
@ -39,7 +40,7 @@ static bool ipv6_proxy_ndp_is_needed(Link *link) {
if (!link->network)
return false;
if (link->network->ipv6_proxy_ndp != -1)
if (link->network->ipv6_proxy_ndp >= 0)
return link->network->ipv6_proxy_ndp;
if (link->network->n_ipv6_proxy_ndp_addresses == 0)
@ -54,6 +55,9 @@ static int ipv6_proxy_ndp_set(Link *link) {
assert(link);
if (!socket_ipv6_is_supported())
return 0;
v = ipv6_proxy_ndp_is_needed(link);
p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/proxy_ndp");
@ -199,6 +203,8 @@ int ipv6_proxy_ndp_addresses_configure(Link *link) {
IPv6ProxyNDPAddress *ipv6_proxy_ndp_address;
int r;
assert(link);
/* enable or disable proxy_ndp itself depending on whether ipv6_proxy_ndp_addresses are set or not */
r = ipv6_proxy_ndp_set(link);
if (r != 0)