network: introduce network_adjust_ipv6_proxy_ndp()

This commit is contained in:
Yu Watanabe
2021-06-08 06:33:27 +09:00
parent 354bc760cd
commit 14d9ab9d32
3 changed files with 19 additions and 0 deletions
+14
View File
@@ -12,6 +12,20 @@
#include "string-util.h"
#include "sysctl-util.h"
void network_adjust_ipv6_proxy_ndp(Network *network) {
assert(network);
if (set_isempty(network->ipv6_proxy_ndp_addresses))
return;
if (!socket_ipv6_is_supported()) {
log_once(LOG_WARNING,
"%s: IPv6 proxy NDP addresses are set, but IPv6 is not supported by kernel, "
"Ignoring IPv6 proxy NDP addresses.", network->filename);
network->ipv6_proxy_ndp_addresses = set_free_free(network->ipv6_proxy_ndp_addresses);
}
}
static int set_ipv6_proxy_ndp_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
int r;
+3
View File
@@ -4,6 +4,9 @@
#include "conf-parser.h"
typedef struct Link Link;
typedef struct Network Network;
void network_adjust_ipv6_proxy_ndp(Network *network);
int link_set_ipv6_proxy_ndp_addresses(Link *link);
+2
View File
@@ -20,6 +20,7 @@
#include "networkd-dhcp-common.h"
#include "networkd-dhcp-server-static-lease.h"
#include "networkd-dhcp-server.h"
#include "networkd-ipv6-proxy-ndp.h"
#include "networkd-manager.h"
#include "networkd-ndisc.h"
#include "networkd-neighbor.h"
@@ -177,6 +178,7 @@ int network_verify(Network *network) {
/* IPMasquerade implies IPForward */
network->ip_forward |= network->ip_masquerade;
network_adjust_ipv6_proxy_ndp(network);
network_adjust_ipv6_accept_ra(network);
network_adjust_dhcp(network);
network_adjust_radv(network);