summaryrefslogtreecommitdiff
path: root/src/network/networkd-routing-policy-rule.h
Commit message (Collapse)AuthorAgeFilesLines
* 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-161-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-261-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-081-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-071-1/+1
| | | | As 'verify' implies a boolean result.
* network: drop unused elementYu Watanabe2020-10-071-1/+0
|
* network: introduce network_verify_routing_policy_rules()Yu Watanabe2020-10-071-1/+2
|
* network: make routing_policy_rule_new() staticYu Watanabe2020-10-071-3/+0
|
* network: move manager_rtnl_process_rule() to networkd-routing-policy-rule.[ch]Yu Watanabe2020-10-071-2/+2
|
* network: drop list of static routing policy rulesYu Watanabe2020-10-071-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-071-1/+1
|
* network: make several functions staticYu Watanabe2020-10-061-5/+0
|
* network: move link_request_set_routing_policy()Yu Watanabe2020-10-061-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
|
* network: include glibc headers before including kernel headersYu Watanabe2019-05-091-0/+1
|
* tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0Yu Watanabe2019-04-111-1/+0
|
* network: drop sections contain invalid settings in network_verify()Yu Watanabe2019-03-131-1/+2
| | | | | | | | | | | If e.g., an [Address] section has an invalid setting, then previously assigned settings in the section is freed, and only later settings are stored. That may cause partially broken section stored in Network object. This makes if an invalid setting is found, then set 'invalid' flag instead of freeing it. And invalid sections are dropped later by network_verify().
* networkd: RPDB rule - add support to configure inverted rule.Susant Sahani2018-12-061-0/+3
| | | | Closes #10706
* util: drop missing.h from util.hYu Watanabe2018-12-041-0/+1
|
* Merge pull request #10976 from yuwata/typesafe-netlink-callLennart Poettering2018-12-031-4/+2
|\ | | | | netlink: introduce typesafe netlink functions
| * network: use typesafe netlink_call_async() macro where applicableYu Watanabe2018-12-021-2/+2
| |
| * network: set default callbacks for routing_policy_rule_configure() and ↵Yu Watanabe2018-12-021-2/+0
| | | | | | | | routing_policy_rule_remove()
* | network: rename Protocol= in [RoutingPolicyRule] to IPProtocol=Yu Watanabe2018-12-021-1/+1
|/
* networkd: add support to configure ip rule port range and protocol.Susant Sahani2018-11-281-3/+13
| | | | | | | | | Please see: iprule: support for ip_proto, sport and dport match options https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f686f764682745daf6a93b0a6330ba42a961f858 Closes 10622
* network: strdup iif and oif when creating RoutingPolicyRule objectYu Watanabe2018-09-271-3/+3
|
* tree-wide: drop double newlineYu Watanabe2018-06-291-1/+0
|
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-3/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macroLennart Poettering2018-05-221-6/+7
| | | | | | | | | | | This makes most header files easier to look at. Also Emacs gets really slow when browsing through large sections of overly long prototypes, which is much improved by this macro. We should probably not do something similar with too many other cases, as macros like this might help readability for some, but make it worse for others. But I think given the complexity of this specific prototype and how often we use it, it's worth doing.