summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-routing-policy-rule.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* network: merge link_foreignize_config() and link_drop_foreign_config()Yu Watanabe2024-11-051-6/+5
| | | | | | | | | | | | | | | When a reconfiguration of an interface is triggered, previously we call link_foreignize_config(), which sets all static configurations as foreign, then later call link_drop_foreign_config(), which drops unnecessary foreign configurations. This commit merges these two steps into one, link_drop_unmanaged_config(), which drops unnecessary static and foreign configurations. Also, this renames link_drop_managed_configs() to link_drop_static_config(), as it only drops static configurations. Note that dynamically aquired configurations are dropped by link_stop_engines().
* network/routing-policy-rule: use in_addr_prefix for From= and To=Yu Watanabe2024-10-111-8/+7
| | | | | | | Also, this makes the settings parsed independently, and the inconsistency will be checked in the section verifier. No functional change, just refactoring.
* sd-netlink,network: rename functions and RoutingPolicyRule.typeYu Watanabe2024-10-101-2/+2
| | | | | To make them consistent to the netlink message header. No functional change, just refactoring.
* network/routing-policy-rule: use config_parse_routing_policy_rule() moreYu Watanabe2024-08-241-9/+11
| | | | | | | Then, we can drop allocation of RoutingPolicyRule object in each conf parsers. No functional change, just refactoring.
* network/routing-policy-rule: introduce a generic conf-parser for ↵Yu Watanabe2024-08-241-6/+13
| | | | | | | | [RoutingPolicyRule] sectin This introduce config_parse_routing_policy_rule(), which wraps existing conf parsers. With this, we can drop many custom conf parsers for [RoutingPolicyRule], and can reuse generic conf parsers in conf-parser.[ch].
* network/routing-policy-rule: merge two conf parsersYu Watanabe2024-08-241-2/+1
| | | | | Both conf parsers takes an integer. Only difference is the maximum value. Let's merge them, and pass the maximum value through ltype.
* network/routing-policy-rule: sort conf-parser prototypesYu Watanabe2024-08-231-10/+10
|
* network/routing-policy-rule: support all known type of ruleYu Watanabe2024-08-201-1/+3
| | | | | | This also adds GoTo= to specify the target priority of goto rule. Note, table was the default but could not be specified in Type=.
* network/routing-policy-rule: also manage remaining attributesYu Watanabe2024-08-201-3/+3
| | | | | | Currently, these attributes are not configured by us, but there may be a existing rule created by user manually with one of these attribute. To correctly manage such foreign rules, let's read these attributes.
* network/routing-policy-rule: introduce ref and unref functions for ↵Yu Watanabe2024-08-191-1/+4
| | | | | | RoutingPolicyRule No functional change, just refactoring and preparation for later change.
* network/routing-policy-rule: manage all flagsYu Watanabe2024-08-191-1/+1
| | | | | | | Currently, only FIB_RULE_INVERT flag can be configurable, but for simplicity and future extension, let's manage all flags. No functional change, just refactoring.
* network/routing-policy-rule: use int32_t for suppress_prefixlenYu Watanabe2024-08-191-1/+1
| | | | | | | | The kernel parses FRA_SUPPRESS_PREFIXLEN as uint32_t, but internally handled as signed integer and negative values as unset. Let's explicitly specify the size of the variable. No functional change, just refactoring.
* network/routing-policy-rule: reorder elements of RoutingPolicyRule and add ↵Yu Watanabe2024-08-191-28/+27
| | | | | | comments No functional change, just refactoring.
* various: move const ptr indicator to return valueZbigniew Jędrzejewski-Szmek2024-06-191-1/+1
|
* network: rename link_drop_managed_xyz() -> link_drop_static_xyz()Yu Watanabe2024-02-141-1/+1
| | | | | | | | | | | | | | As networkd does not configure nexthops, neighbors, or routing policy rules dynamically, this only changes link_drop_managed_addresses(). Previously it also removed dynamic addresses, but with this commit, now it only removes static addresses. Note, link_drop_managed_routes() has removed only static routes, so this commit only changes its name. Note. as commented in the code, the dynamic addresses will be removed on lease expiration or stopping client, and link_drop_managed_xyz() are called on reconfiguration or so, and at that time, all dynamic addressing clients are stopped or restarted, so this should not effective behavior change.
* network: Add L3MasterDevice= into routing policyNick Cao2024-01-191-1/+2
|
* network: re-design request queueYu Watanabe2022-03-111-5/+0
| | | | | | | | This makes Request object takes hash, compare, free, and process functions. With this change, the logic in networkd-queue.c can be mostly independent of the type of the request or the object (e.g. Address) assigned to the request, and it becomes simpler.
* network: make request_process_address() and friends take Link and ↵Yu Watanabe2022-03-111-1/+1
| | | | | | | | | | | | | | | | | corresponding object This also renames e.g. request_process_address() -> address_process_request(). Also, this drops type checks such as `assert(req->type == REQUEST_TYPE_ADDRESS)`, as in the later commits, the function of processing request, e.g. `address_process_request()`, will be assigned to the Request object when it is created. And the request type will be used to distinguish and to avoid deduplicating requests which do not have any assigned objects, like REQUEST_TYPE_DHCP4_CLIENT. Hence, the type checks in process functions are mostly not necessary and redundant. This is mostly cleanups and preparation for later commits, and should not change any behavior.
* network: remove only managed configs on reconfigure or carrier lostYu Watanabe2022-02-011-1/+1
| | | | | | Otherwise, if the carrir of the non-managed interface is lost, the configs such as addresses or routes on the interface will be removed by networkd.
* network: rename NetworkConfigSection -> ConfigSectionYu Watanabe2022-01-191-1/+1
| | | | And move it and relevant functions to conf-parser.[ch].
* network: routing policy rule: introduce fr_act_type_full_to_string()Yu Watanabe2021-11-251-0/+2
|
* network: Add SuppressInterfaceGroup= into routing policySlava Bacherikov2021-11-151-0/+2
| | | | | This adds SuppressInterfaceGroup= option in the [RoutingPolicyRule] section which has the same semantics as suppress_ifgroup in `ip rule` command.
* network: delay dropping addresses or so on reloading .network filesYu Watanabe2021-10-261-0/+1
| | | | | | | When a .network file is updated but its change is not so big, it is not necessary to first drop all configs and then reassign later again. This slightly optimize such situation. First foreignize all configs, and then drop later when it is not requested by the updated .network file.
* network: rename functionYu Watanabe2021-10-251-2/+3
|
* network: use NetworkConfigSource/State to manage routing policy rulesYu Watanabe2021-09-151-0/+4
| | | | | | | | This also changes the logic when Priority= is not specified. Previously, we request without FRA_PRIORITY attribute and kernel picks the highest unused priority for the rule. This makes networkd picks the highest unused priority and always request FRA_PRIORITY attribute.
* network: do not assume the highest priority when Priority= is unspecifiedYu Watanabe2021-08-181-0/+1
| | | | | | | | | | | | | Previously, when Priority= is unspecified, networkd configured the rule with the highest (=0) priority. This commit makes networkd distinguish the case the setting is unspecified and one explicitly specified as Priority=0. Note. 1) If the priority is unspecified on configure, then kernel dynamically picks a priority for the rule. 2) The new behavior is consistent with 'ip rule' command. Replaces #15606.
* network: expose hash and compare functionsYu Watanabe2021-06-071-0/+3
|
* network: use request queue to configure routing policy rulesYu Watanabe2021-05-121-4/+4
|
* network: do not serialize/deserialize routing policy rulesYu Watanabe2020-12-291-3/+0
| | | | | | We already handle foreign routing policy rules correctly by the previous commit. So, the serialization/deserialization of rules are not necessary anymore.
* network: drop unnecessary routing policy rulesYu Watanabe2020-12-291-0/+7
| | | | | | | | | | | | networkd already drop foreign address, routes, and nexthops on startup, except those created by kernel. However, previously, routing policy rules were not. The logic of serialization/deserialization of rules only works for rules created by previous invocation of networkd, and does not work for one created by other tools like `ip rule`. This makes networkd drop foreign routing policy rules except created by kernel on startup. Also, remove rules created by networkd when the corresponding links are dropped or networkd is stopping.
* network: treat rule which has l3mdev flag as created by kernelYu Watanabe2020-12-291-0/+1
|
* network: set FRA_PROTOCOL to RTPROT_STATIC by defaultYu Watanabe2020-12-291-1/+2
|
* network: Allow to configure unreachable/blackhole RoutingPolicyRule (#17984)Susant Sahani2020-12-181-2/+4
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* network: rename network_verify_xxx() -> network_drop_invalid_xxx()Yu Watanabe2020-10-061-1/+1
| | | | As 'verify' implies a boolean result.
* network: drop unused elementYu Watanabe2020-10-061-1/+0
|
* network: introduce network_verify_routing_policy_rules()Yu Watanabe2020-10-061-1/+2
|
* network: make routing_policy_rule_new() staticYu Watanabe2020-10-061-3/+0
|
* network: move manager_rtnl_process_rule() to networkd-routing-policy-rule.[ch]Yu Watanabe2020-10-061-2/+2
|
* network: drop list of static routing policy rulesYu Watanabe2020-10-061-12/+5
| | | | | [RoutingPolicyRule] sections are managed by both LIST and Hashmap. Let's drop list.
* network: make routing_policy_rule_free() returns NULLYu Watanabe2020-10-061-1/+1
|
* network: make several functions staticYu Watanabe2020-10-051-5/+0
|
* network: move link_request_set_routing_policy()Yu Watanabe2020-10-051-0/+2
|
* network: add debug log for removing routing policy rulesYu Watanabe2020-09-101-2/+2
|
* network: add SuppressPrefixLength option to RoutingPolicyRule (#14736)Naïm Favier2020-02-031-0/+3
| | | Closes #14724.
* network: support UID based routing policyYu Watanabe2020-02-021-0/+2
| | | | Closes #14666.
* network: add RoutingPolicyRule.Family= settingYu Watanabe2019-08-161-1/+3
| | | | Closes #13233.
* network: refuse the case To= and From= are in different address familyYu Watanabe2019-08-161-0/+1
|
* network: add missing entries in routing_policy_rule_{hash,compare}_func()Yu Watanabe2019-06-191-9/+2
| | | | | This also makes routing_policy_rule_get() or friends take a RoutingPolicyRule object as an input.
* network: remove unused argument in routing_policy_rule_configure()Yu Watanabe2019-06-041-1/+1
|