if (set_isempty(network->match_mac) && set_isempty(network->match_permanent_mac) &&
strv_isempty(network->match_path) && strv_isempty(network->match_driver) &&
strv_isempty(network->match_type) && strv_isempty(network->match_name) &&
- strv_isempty(network->match_property) && strv_isempty(network->match_ssid) && !network->conditions)
+ strv_isempty(network->match_property) && strv_isempty(network->match_wlan_iftype) &&
+ strv_isempty(network->match_ssid) && !network->conditions)
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
"%s: No valid settings found in the [Match] section, ignoring file. "
"To match all interfaces, add Name=* in the [Match] section.",
if (network->dhcp_use_gateway < 0)
network->dhcp_use_gateway = network->dhcp_use_routes;
+ if (network->ignore_carrier_loss < 0)
+ network->ignore_carrier_loss = network->configure_without_carrier;
+
if (network->dhcp_critical >= 0) {
if (network->keep_configuration >= 0)
log_warning("%s: Both KeepConfiguration= and deprecated CriticalConnection= are set. "
.dhcp_use_timezone = false,
.rapid_commit = true,
+ .dhcp6_route_metric = DHCP_ROUTE_METRIC,
.dhcp6_use_ntp = true,
.dhcp6_use_dns = true,
- .dhcp_server_emit_dns = true,
- .dhcp_server_emit_ntp = true,
- .dhcp_server_emit_sip = true,
+ .dhcp6_pd_assign_prefix = true,
+
+ .dhcp_server_emit[SD_DHCP_LEASE_DNS].emit = true,
+ .dhcp_server_emit[SD_DHCP_LEASE_NTP].emit = true,
+ .dhcp_server_emit[SD_DHCP_LEASE_SIP].emit = true,
+
.dhcp_server_emit_router = true,
.dhcp_server_emit_timezone = true,
+ .router_prefix_subnet_id = -1,
.router_emit_dns = true,
.router_emit_domains = true,
/* If LinkLocalAddressing= is not set, then set to ADDRESS_FAMILY_IPV6 later. */
.link_local = _ADDRESS_FAMILY_INVALID,
+ .ipv6ll_address_gen_mode = _IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_INVALID,
+
+ .ipv4_accept_local = -1,
.ipv6_privacy_extensions = IPV6_PRIVACY_EXTENSIONS_NO,
.ipv6_accept_ra = -1,
.ipv6_accept_ra_route_table_set = false,
.ipv6_accept_ra_start_dhcp6_client = true,
+ .configure_without_carrier = false,
+ .ignore_carrier_loss = -1,
.keep_configuration = _KEEP_CONFIGURATION_INVALID,
- .ipv6_address_gen_mode = _LINK_IPV6_ADDRESS_GEN_MODE_INVALID,
.can_triple_sampling = -1,
.can_termination = -1,
.ip_service_type = -1,
};
- r = config_parse_many(filename, NETWORK_DIRS, dropin_dirname,
- "Match\0"
- "Link\0"
- "Network\0"
- "Address\0"
- "Neighbor\0"
- "IPv6AddressLabel\0"
- "RoutingPolicyRule\0"
- "Route\0"
- "NextHop\0"
- "DHCP\0" /* compat */
- "DHCPv4\0"
- "DHCPv6\0"
- "DHCPServer\0"
- "IPv6AcceptRA\0"
- "IPv6NDPProxyAddress\0"
- "Bridge\0"
- "BridgeFDB\0"
- "BridgeVLAN\0"
- "IPv6PrefixDelegation\0"
- "IPv6Prefix\0"
- "IPv6RoutePrefix\0"
- "LLDP\0"
- "TrafficControlQueueingDiscipline\0"
- "CAN\0"
- "QDisc\0"
- "BFIFO\0"
- "CAKE\0"
- "ControlledDelay\0"
- "DeficitRoundRobinScheduler\0"
- "DeficitRoundRobinSchedulerClass\0"
- "PFIFO\0"
- "PFIFOFast\0"
- "PFIFOHeadDrop\0"
- "FairQueueing\0"
- "FairQueueingControlledDelay\0"
- "GenericRandomEarlyDetection\0"
- "HeavyHitterFilter\0"
- "HierarchyTokenBucket\0"
- "HierarchyTokenBucketClass\0"
- "NetworkEmulator\0"
- "PIE\0"
- "StochasticFairBlue\0"
- "StochasticFairnessQueueing\0"
- "TokenBucketFilter\0"
- "TrivialLinkEqualizer\0",
- config_item_perf_lookup, network_network_gperf_lookup,
- CONFIG_PARSE_WARN, network);
+ r = config_parse_many(
+ filename, NETWORK_DIRS, dropin_dirname,
+ "Match\0"
+ "Link\0"
+ "Network\0"
+ "Address\0"
+ "Neighbor\0"
+ "IPv6AddressLabel\0"
+ "RoutingPolicyRule\0"
+ "Route\0"
+ "NextHop\0"
+ "DHCP\0" /* compat */
+ "DHCPv4\0"
+ "DHCPv6\0"
+ "DHCPServer\0"
+ "IPv6AcceptRA\0"
+ "IPv6NDPProxyAddress\0"
+ "Bridge\0"
+ "BridgeFDB\0"
+ "BridgeVLAN\0"
+ "IPv6PrefixDelegation\0"
+ "IPv6Prefix\0"
+ "IPv6RoutePrefix\0"
+ "LLDP\0"
+ "TrafficControlQueueingDiscipline\0"
+ "CAN\0"
+ "QDisc\0"
+ "BFIFO\0"
+ "CAKE\0"
+ "ControlledDelay\0"
+ "DeficitRoundRobinScheduler\0"
+ "DeficitRoundRobinSchedulerClass\0"
+ "EnhancedTransmissionSelection\0"
+ "FairQueueing\0"
+ "FairQueueingControlledDelay\0"
+ "GenericRandomEarlyDetection\0"
+ "HeavyHitterFilter\0"
+ "HierarchyTokenBucket\0"
+ "HierarchyTokenBucketClass\0"
+ "NetworkEmulator\0"
+ "PFIFO\0"
+ "PFIFOFast\0"
+ "PFIFOHeadDrop\0"
+ "PIE\0"
+ "QuickFairQueueing\0"
+ "QuickFairQueueingClass\0"
+ "StochasticFairBlue\0"
+ "StochasticFairnessQueueing\0"
+ "TokenBucketFilter\0"
+ "TrivialLinkEqualizer\0",
+ config_item_perf_lookup, network_network_gperf_lookup,
+ CONFIG_PARSE_WARN,
+ network,
+ &network->timestamp);
if (r < 0)
return r;
log_warning_errno(r, "%s: Failed to add default route on device, ignoring: %m",
network->filename);
- struct stat stats;
- if (stat(filename, &stats) < 0)
- return -errno;
- network->timestamp = timespec_load(&stats.st_mtim);
-
if (network_verify(network) < 0)
/* Ignore .network files that do not match the conditions. */
return 0;
free(network->dhcp_mudurl);
strv_free(network->dhcp_user_class);
free(network->dhcp_hostname);
- set_free(network->dhcp_black_listed_ip);
+ set_free(network->dhcp_deny_listed_ip);
set_free(network->dhcp_request_options);
set_free(network->dhcp6_request_options);
free(network->mac);
strv_free(network->ntp);
free(network->dns);
- strv_free(network->sip);
- strv_free(network->smtp);
ordered_set_free_free(network->search_domains);
ordered_set_free_free(network->route_domains);
strv_free(network->bind_carrier);
ordered_set_free_free(network->router_search_domains);
free(network->router_dns);
- set_free_free(network->ndisc_black_listed_prefix);
+ set_free_free(network->ndisc_deny_listed_prefix);
free(network->bridge_name);
free(network->bond_name);
free(network->name);
free(network->dhcp_server_timezone);
- free(network->dhcp_server_dns);
- free(network->dhcp_server_ntp);
- free(network->dhcp_server_sip);
+
+ for (sd_dhcp_lease_server_type t = 0; t < _SD_DHCP_LEASE_SERVER_TYPE_MAX; t++)
+ free(network->dhcp_server_emit[t].addresses);
set_free_free(network->dnssec_negative_trust_anchors);
ordered_hashmap_free(network->dhcp_server_send_options);
ordered_hashmap_free(network->dhcp_server_send_vendor_options);
ordered_hashmap_free(network->ipv6_tokens);
+ ordered_hashmap_free(network->dhcp6_client_send_options);
+ ordered_hashmap_free(network->dhcp6_client_send_vendor_options);
return mfree(network);
}
}
int network_get(Manager *manager, unsigned short iftype, sd_device *device,
- const char *ifname, char * const *alternative_names,
- const struct ether_addr *address, const struct ether_addr *permanent_address,
+ const char *ifname, char * const *alternative_names, const char *driver,
+ const struct ether_addr *mac, const struct ether_addr *permanent_mac,
enum nl80211_iftype wlan_iftype, const char *ssid, const struct ether_addr *bssid,
Network **ret) {
Network *network;
network->match_path, network->match_driver,
network->match_type, network->match_name, network->match_property,
network->match_wlan_iftype, network->match_ssid, network->match_bssid,
- iftype, device, address, permanent_address,
+ device, mac, permanent_mac, driver, iftype,
ifname, alternative_names, wlan_iftype, ssid, bssid)) {
if (network->match_name && device) {
const char *attr;
continue;
}
- r = set_ensure_allocated(&n->dnssec_negative_trust_anchors, &dns_name_hash_ops);
+ r = set_ensure_consume(&n->dnssec_negative_trust_anchors, &dns_name_hash_ops, TAKE_PTR(w));
if (r < 0)
return log_oom();
-
- r = set_put(n->dnssec_negative_trust_anchors, w);
- if (r < 0)
- return log_oom();
- if (r > 0)
- w = NULL;
}
return 0;
};
DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(keep_configuration, KeepConfiguration, KEEP_CONFIGURATION_YES);
+
+static const char* const ipv6_link_local_address_gen_mode_table[_IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_MAX] = {
+ [IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_EUI64] = "eui64",
+ [IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_NONE] = "none",
+ [IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_STABLE_PRIVACY] = "stable-privacy",
+ [IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_RANDOM] = "random",
+};
+
+DEFINE_STRING_TABLE_LOOKUP(ipv6_link_local_address_gen_mode, IPv6LinkLocalAddressGenMode);
+DEFINE_CONFIG_PARSE_ENUM(config_parse_ipv6_link_local_address_gen_mode, ipv6_link_local_address_gen_mode, IPv6LinkLocalAddressGenMode, "Failed to parse IPv6 link local address generation mode");