Commit Graph

111 Commits

Author SHA1 Message Date
Yu Watanabe 40424f1ad9 network: introduce routing_policy_rule_equal() 2020-12-14 23:30:16 +09:00
Yu Watanabe 18f2ee3310 network: make routing_policy_rule_remove() take Manager instead of Link
As routing policy rules are managed by Manager.
2020-12-14 23:30:16 +09:00
Yu Watanabe bd4733da64 network: do not configure static configs more than once simultaneously 2020-12-11 14:39:46 +09:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Yu Watanabe 13ffa39f8e network: rename network_verify_xxx() -> network_drop_invalid_xxx()
As 'verify' implies a boolean result.
2020-10-07 03:22:03 +09:00
Yu Watanabe d08ed5a1fd network: specify all known attributes when removing routing policy rules
Otherwise, routing_policy_rule_remove() may removes unintended rule.
2020-10-07 02:36:29 +09:00
Yu Watanabe 5a82104bf3 network: add missing "else" 2020-10-07 02:36:29 +09:00
Yu Watanabe 6f3337277f network: drop unused element 2020-10-07 02:36:29 +09:00
Yu Watanabe 50a3682f1e network: introduce network_verify_routing_policy_rules() 2020-10-07 02:36:29 +09:00
Yu Watanabe f1828a222a network: make routing_policy_rule_new() static 2020-10-07 02:36:29 +09:00
Yu Watanabe 51a0dc4a15 network: move manager_rtnl_process_rule() to networkd-routing-policy-rule.[ch] 2020-10-07 02:36:29 +09:00
Yu Watanabe ca183bf8fd network: drop list of static routing policy rules
[RoutingPolicyRule] sections are managed by both LIST and Hashmap.
Let's drop list.
2020-10-07 02:36:29 +09:00
Yu Watanabe 02e9f4e536 network: do not duplicate rule if Family=both 2020-10-07 02:36:29 +09:00
Yu Watanabe b0815fa499 network: make routing_policy_rule_free() returns NULL 2020-10-07 02:36:29 +09:00
Yu Watanabe 816ef8d1da network: add more logs on loading routing policy rules failure
And reduce scope of variables.
2020-10-07 02:36:24 +09:00
Yu Watanabe eb3445ce93 network: reduce scope of variables 2020-10-06 00:51:01 +09:00
Yu Watanabe ddc9df3183 network: drop routing_policy_rule_make_local()
Its error handling was bogus...
2020-10-06 00:51:01 +09:00
Yu Watanabe 7532b88808 network: make several functions static 2020-10-06 00:51:01 +09:00
Yu Watanabe c0ec474675 network: move link_request_set_routing_policy() 2020-10-06 00:51:01 +09:00
Yu Watanabe 17d2b2e4ef network: replace FRA_IFNAME -> FRA_IIFNAME
No functional change, as FRA_IFNAME is an alias of FRA_IIFNAME.
2020-09-10 18:57:07 +09:00
Yu Watanabe bd1000b4a0 network: fix the default mask for FirewallMark=
And always send FRA_FWMASK if FirewallMark= is set.

C.f. b8964ed9fa

Partially fixes #16784.
2020-09-10 18:56:18 +09:00
Yu Watanabe c2d6fcb147 network: do not assign return value if the parse_fwmark_fwmask() fails
This also removes redundant logs, and makes input string not copied if
it does not contain '/'.
2020-09-10 18:19:03 +09:00
Yu Watanabe d85b0d69f1 network: add debug log for removing routing policy rules 2020-09-10 18:19:03 +09:00
Yu Watanabe 755dbda355 network: also logs priority of routing policy rules 2020-09-10 18:18:59 +09:00
Zbigniew Jędrzejewski-Szmek 90e74a66e6 tree-wide: define iterator inside of the macro 2020-09-08 12:14:05 +02:00
Yu Watanabe 5c72a6d5d3 network: logs about unknown key 2020-09-04 08:48:08 +09:00
Yu Watanabe f405179d65 network: honor already specified family when parsing from= or to= in serialized rule 2020-09-04 08:48:08 +09:00
Yu Watanabe 9d6282d120 network: do not reallocate buffer 2020-09-04 08:48:04 +09:00
Yu Watanabe d0ac05613b network: serialize InvertRule= in [RoutingPolicyRule] 2020-09-04 08:47:22 +09:00
Yu Watanabe 1680b11df4 network: add whitespace after family= and priority= in serialized routing policy rule
This also makes priority= serialized only when its value is non-zero.
2020-09-04 08:44:19 +09:00
Yu Watanabe 3c94b20dd3 network: downgrade error level when the error is ignored 2020-09-04 08:44:14 +09:00
Yu Watanabe 7e60a37d04 network: move routing_policy_rule_read_full_file() 2020-09-04 08:42:01 +09:00
Yu Watanabe 8eec0b9da5 network: set key destructor in several hash_ops 2020-07-29 02:05:05 +09:00
Yu Watanabe f281fc1e95 tree-wide: use siphash24_compress_string() where it is applicable 2020-07-22 19:55:14 +09:00
Yu Watanabe d96edb2c6e network: downgrade log level in conf parsers 2020-07-17 00:40:09 +09:00
Zbigniew Jędrzejewski-Szmek 0da425df65 networkd: use capitalized "IP" and "TOS" in messages 2020-07-07 12:06:26 +02:00
Zbigniew Jędrzejewski-Szmek de7fef4b6e tree-wide: use set_ensure_put()
Patch contains a coccinelle script, but it only works in some cases. Many
parts were converted by hand.

Note: I did not fix errors in return value handing. This will be done separate
to keep the patch comprehensible. No functional change is intended in this
patch.
2020-06-22 16:32:37 +02:00
Naïm Favier 53e1ba280f
network: add SuppressPrefixLength option to RoutingPolicyRule (#14736)
Closes #14724.
2020-02-03 08:25:48 +09:00
Yu Watanabe ea471a4695 network: support UID based routing policy
Closes #14666.
2020-02-02 22:43:38 +09:00
Yu Watanabe 98b0299479 network: append INTERFACE= attributes for logs corresponds to a netif 2020-01-07 22:20:43 +09:00
Yu Watanabe 5ecb131d94 network: include NLMSGERR_ATTR_MSG attribute in error message 2019-11-30 16:14:02 +09:00
Zbigniew Jędrzejewski-Szmek 314ed4f994 networkd: unbreak routing_policy_rule_compare_func()
!r is the same r == 0, so this was short-circuiting the comparison when
streq(a->iff, b->iff) or streq(a->off, b->off). Before the parent commit which
moved those comparisons to the end, this was short-circuiting quite a bit
of the comparison function.
2019-09-17 19:27:58 +02:00
Zbigniew Jędrzejewski-Szmek 67e05dd8cd networkd: use same order in _hash_func() and _compare_func()
This makes it easier to see that the same data is handled in both cases.
No functional change.
2019-09-17 19:11:50 +02:00
Yu Watanabe 1520151268 network: add more debug messages 2019-09-15 22:33:11 +09:00
Zbigniew Jędrzejewski-Szmek 57ad760746 network: drop all checks of ipv6_disabled sysctl
*We* control the sysctl setting. If the user configured IPv6, then we apply the
settings, and just make sure that at some point during the configuration the
sysctl is disabled (i.e. ipv6 enabled) if we have IPv6 configured.

Replaces #13283.
2019-08-27 15:31:48 +02:00
Yu Watanabe f6c6ff97f5 network: add RoutingPolicyRule.Family= setting
Closes #13233.
2019-08-16 22:02:17 +09:00
Yu Watanabe 01fc8e4f43 network: split out copying logic from routing_policy_rule_add_internal() 2019-08-16 22:02:17 +09:00
Yu Watanabe ec863cdc20 network: add missing entry in serialization/deserialization 2019-08-16 22:01:17 +09:00
Yu Watanabe 43e08c78c7 network: serialize/deserialize address family 2019-08-16 22:01:17 +09:00
Yu Watanabe 0aabccc87d network: refuse the case To= and From= are in different address family 2019-08-16 22:01:17 +09:00