Yu Watanabe
0a35458f5e
network/qdisc: do not save qdisc to Link before it is configured
...
Otherwise, if the same kind of qdisc is already assigned, parameters
configured in .network file will not be used. So, let's first copy the
qdisc and put it on Request, then on success generate a new copy based
on the netlink notification and store it to Link.
This is the same as 0a0c2672db ,
65f5f58156 , and friends, but for qdisc.
Preparation for fixing #31226 .
2024-09-02 14:12:49 +09:00
Yu Watanabe
3d7f26d9f2
network/tclass: make tclass_drop() static
...
This also drops unused constant return value.
2024-09-02 14:12:49 +09:00
Yu Watanabe
4a31c768a9
network/qdisc: make qdisc_drop() static
...
This also drops unused constant return value.
2024-09-02 14:12:49 +09:00
Yu Watanabe
e3f91033ae
network/tclass: skip requesting tclass if it is already requested
2024-09-02 14:12:49 +09:00
Yu Watanabe
998973e313
network/qdisc: skip requesting qdisc if it is already requested
2024-09-02 14:12:49 +09:00
Yu Watanabe
4bdc3d85ae
network/neighbor: skip requesting neighbor if it is already requested
2024-09-02 14:12:37 +09:00
Yu Watanabe
541d0ed20a
network/tclass: introduce tclass_ref() and tclass_unref()
...
No functional change, just refactoring and preparation for later change.
2024-09-02 14:12:35 +09:00
Yu Watanabe
9b294afa2d
network/qdisc: introduce qdisc_ref() and qdisc_unref()
...
No functional change, just refactoring and preparation for later change.
2024-09-02 14:12:35 +09:00
Yu Watanabe
42efe5be1d
tree-wide: drop msg argument for DEFINE_CONFIG_PARSE() macro and friends
...
This makes the macros use log_syntax_parse_error(), hopefully which provides
more informative log message in general, and reduces binary size.
2024-09-02 05:45:09 +09:00
Yu Watanabe
b043f651c8
test: modernize test-networkd-conf
2024-09-02 05:41:55 +09:00
Yu Watanabe
9afb4aea00
network/route: fix typo
...
Follow-up for c8dbf9acc1 .
2024-09-01 22:03:12 +09:00
Yu Watanabe
c8dbf9acc1
network/route: fix adjustment of nexthop weight
...
Fixes #34167 .
2024-09-01 11:54:32 +09:00
Yu Watanabe
db8dc7c1dd
network/route: also update source, status, and so on EEXIST
...
Otherwise, an existing route may be labeled as foreign even after we
reconfigure it.
2024-09-01 11:54:32 +09:00
Yu Watanabe
0074a7d8c0
network/route: also show weight of gateway in debugging logs
2024-09-01 11:54:32 +09:00
Yu Watanabe
605377e7b3
network/routing-policy-rule: use config_parse_routing_policy_rule() more
...
Then, we can drop allocation of RoutingPolicyRule object in each conf
parsers.
No functional change, just refactoring.
2024-08-25 06:25:07 +09:00
Yu Watanabe
7f66a94ecf
network/routing-policy-rule: introduce a generic conf-parser for [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].
2024-08-25 06:19:51 +09:00
Yu Watanabe
f7a1e57e1f
conf-parser: move config_parse_ip_protocol() from network/netdev/fou-tunnel.c
...
The function is generic enough. Currently it is used at only one place.
But it will be used at another place.
2024-08-25 06:18:46 +09:00
Yu Watanabe
74601abcdd
network/routing-policy-rule: merge two conf parsers
...
Both conf parsers takes an integer. Only difference is the maximum
value. Let's merge them, and pass the maximum value through ltype.
2024-08-25 06:17:05 +09:00
Yu Watanabe
78ff6156d1
network/routing-policy-rule: trivial cleanups for conf-parsers
...
No functional change, just refactoring.
2024-08-25 06:16:29 +09:00
Yu Watanabe
e0978eb8cf
network/routing-policy-rule: rename n -> rule
2024-08-25 05:38:05 +09:00
Yu Watanabe
4e03518b16
Merge pull request #34111 from yuwata/log_section_full_errno
...
network: introduce log_section_full_errno() and friends, and use them
2024-08-24 08:31:02 +09:00
Yu Watanabe
4388efca4a
network/routing-policy-rule: use log_section_warning_errno()
2024-08-24 00:05:49 +09:00
Yu Watanabe
361f70f707
network/routing-policy-rule: read FRA_PROTOCOL afer reading other properties
...
No functional change, just refactoring.
2024-08-23 23:57:17 +09:00
Yu Watanabe
21719d67c1
network/routing-policy-rule: add more assertions
2024-08-23 23:57:17 +09:00
Yu Watanabe
18c9e9acd5
network/routing-policy-rule: sort conf-parser prototypes
2024-08-23 23:57:13 +09:00
Mike Yuan
fad3feec12
shared/logs-show: introduce journal_browse_prepare()
...
which combines sigbus_install() and bumping fd limit.
2024-08-22 20:33:22 +02:00
Yu Watanabe
04d10fdb1d
network/routing-policy-rule: use address family of existing rule when judging if existing rule can be updated
...
Otherwise, the other RoutingPolicyRule object may not have a valid
address family yet, and the existing rule may be wrongly handled as
that it is not requested by any interface, and it may be removed.
Follow-up for 727235006a .
Fixes #34068 .
2024-08-22 04:11:52 +09:00
Yu Watanabe
2276483a7d
Merge pull request #34054 from yuwata/network-failed-state
...
network: several fixlets for reconfiguration after entered failed state
2024-08-22 01:22:29 +09:00
Yu Watanabe
1bf49198b5
networkctl: split networkctl.c into small pieces
...
No functional change, just refactoring.
2024-08-22 01:12:39 +09:00
Luca Boccassi
bdf75118ba
Merge pull request #34049 from yuwata/network-routing-policy-rule
...
network: further rework for routing policy rule
2024-08-21 12:46:37 +02:00
Yu Watanabe
7321a87b53
network/ipv4acd: adjust comment and logging
2024-08-21 11:45:57 +09:00
Yu Watanabe
021d39d3d1
network: log and enter failed state in link_reconfigure()
...
No functional change, just refactoring.
2024-08-21 07:29:30 +09:00
Yu Watanabe
685fd0d729
network: enter initialized state when the interface will be reconfigured
...
When the interface is in the failed state, link_getlink_handler_internal()
will do nothing and return zero, thus the interface will not be
reconfigured, especially when the reconfiguration is triggered in
link_enter_failed().
Follow-up for c2eb7753dd .
2024-08-21 07:29:19 +09:00
Yu Watanabe
ebf66d0c05
network: introduce reconfigure_data_free() and _freep()
...
No functional change, just refactoring.
2024-08-21 07:24:43 +09:00
Yu Watanabe
ac1d8aa5bc
network/routing-policy-rule: support all known type of rule
...
This also adds GoTo= to specify the target priority of goto rule.
Note, table was the default but could not be specified in Type=.
2024-08-20 21:02:31 +09:00
Yu Watanabe
3ac8148e20
network/routing-policy-rule: also manage remaining attributes
...
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.
2024-08-20 21:02:30 +09:00
Yu Watanabe
727235006a
network/routing-policy-rule: remove rules that have conflicting flags
...
The kernel does not distinguish rules with different flags in
rule_exists(), but the flags of an existing rule cannot be updated.
Let's remove rules that have conflicting flags, and configure new rules
later with requested flags.
2024-08-20 21:02:30 +09:00
Yu Watanabe
689438419b
network/routing-policy-rule: anyway detach rule even when we fail to remove it
...
When we fail to remove a rule, that mostly means the rule does not exist
in the kernel anymore, e.g. already removed manually and we have not
received notification about that yet.
Let's detach the rule in that case.
2024-08-20 21:02:30 +09:00
Yu Watanabe
65f5f58156
network/routing-policy-rule: do not save rule to Manager before it is configured
...
Otherwise, if we fail to configure the rule, then the manager will keep
nonexistent rule forever. So, let's first copy the rule and put it on
Request, then on success generate a new copy based on the netlink
notification and store it to Manager.
This is the same as 0a0c2672db , but for
routing policy rule.
2024-08-20 21:02:30 +09:00
Yu Watanabe
4f8b153d90
network/routing-policy-rule: skip requesting when rule is already requested
...
If it is already requested, the new request will be anyway silently refused by
link_queue_request_safe(), which returns 0 in such case. Let's return earlier.
There should be no functional change, just refactoring.
2024-08-20 21:00:05 +09:00
Yu Watanabe
489671d225
network/address-label: allow to configure IPv6 address label in networkd.conf
...
Closes #23159 .
2024-08-20 20:50:56 +09:00
Yu Watanabe
477defd774
network/queue: introduce manager_queue_request_full()
...
Currently it is not used, but will be used later.
2024-08-20 20:49:32 +09:00
Yu Watanabe
7b2e07ca4c
network/address-label: split out address_label_fill_message()
...
No functional change, just refactoring and preparation for later
commits.
2024-08-20 20:49:28 +09:00
Yu Watanabe
4dfbecd2ff
network/address-label: several cleanups for conf parsers
...
- Check userdata, instead of data, though they point to the same
position.
- Support an empty string.
- Use UINT32_MAX, as the label is uint32_t.
2024-08-20 20:48:48 +09:00
Yu Watanabe
c95fa6acb5
network/address-label: introduce custom hash_ops
...
No functional change, just refactoring.
2024-08-20 20:48:48 +09:00
Yu Watanabe
d37afb5779
network/routing-policy-rule: add trailing period to the log message
2024-08-20 20:48:26 +09:00
Yu Watanabe
fc58350aa4
network/routing-policy-rule: do not modify RountingPolicyRule objects managed by Manager or Network
...
They are stored in Manager.rules set or Network.rules_by_section hashmap.
For safety, let's not edit them even temporarily.
No functional change, just refactoring.
2024-08-20 20:48:26 +09:00
Luca Boccassi
a8d1f9da55
Merge pull request #34009 from yuwata/network-resolve-polkit
...
network,resolve: support interactive authentication
2024-08-20 12:14:03 +02:00
Luca Boccassi
a16079fccc
Merge pull request #34014 from yuwata/network-ip-masquerade
...
network: make IPMasquerade= imply global IP forwarding settings again
2024-08-20 11:59:30 +02:00
Yu Watanabe
93f91df671
network/routing-policy-rule: drop unused argument
2024-08-20 02:21:21 +09:00