}
void network_config_section_free(NetworkConfigSection *cs) {
- free(cs);
+ free(cs);
}
/* Set defaults following RFC7844 */
LIST_HEAD_INIT(network->ipv6_proxy_ndp_addresses);
LIST_HEAD_INIT(network->address_labels);
LIST_HEAD_INIT(network->static_prefixes);
+ LIST_HEAD_INIT(network->rules);
network->stacked_netdevs = hashmap_new(&string_hash_ops);
if (!network->stacked_netdevs)
if (!network->prefixes_by_section)
return log_oom();
+ network->rules_by_section = hashmap_new(&network_config_hash_ops);
+ if (!network->rules_by_section)
+ return log_oom();
+
network->filename = strdup(filename);
if (!network->filename)
return log_oom();
"Network\0"
"Address\0"
"IPv6AddressLabel\0"
+ "RoutingPolicyRule\0"
"Route\0"
"DHCP\0"
"DHCPv4\0" /* compat */
}
void network_free(Network *network) {
- NetDev *netdev;
- Route *route;
- Address *address;
- FdbEntry *fdb_entry;
IPv6ProxyNDPAddress *ipv6_proxy_ndp_address;
+ RoutingPolicyRule *rule;
+ FdbEntry *fdb_entry;
AddressLabel *label;
Prefix *prefix;
+ Address *address;
+ NetDev *netdev;
+ Route *route;
Iterator i;
if (!network)
while ((prefix = network->static_prefixes))
prefix_free(prefix);
+ while ((rule = network->rules))
+ routing_policy_rule_free(rule);
+
hashmap_free(network->addresses_by_section);
hashmap_free(network->routes_by_section);
hashmap_free(network->fdb_entries_by_section);
hashmap_free(network->address_labels_by_section);
hashmap_free(network->prefixes_by_section);
+ hashmap_free(network->rules_by_section);
if (network->manager) {
if (network->manager->networks)
netdev->kind != NETDEV_KIND_VTI &&
netdev->kind != NETDEV_KIND_VTI6 &&
netdev->kind != NETDEV_KIND_IP6TNL
- ) {
+ ) {
log_syntax(unit, LOG_ERR, filename, line, 0,
"NetDev is not a tunnel, ignoring assignment: %s", rvalue);
return 0;