Luca Boccassi
aa3ee22592
Merge pull request #30955 from yuwata/network-queue-request_detach
...
network/queue: cleanups for detaching request
2024-01-16 21:17:32 +00:00
Luca Boccassi
eda07d7fcf
Merge pull request #30949 from yuwata/network-route-cosmetic-cleanups
...
network/route: several cosmetic cleanups
2024-01-16 21:16:09 +00:00
Yu Watanabe
3255bda698
network: make 'carrier' as the default required operational state for CAN device
...
As CAN devices do not support IP address, hence the state never goes to
higher than 'carrier'.
Prompted by https://github.com/linux-can/can-utils/issues/68#issuecomment-1327987724 .
2024-01-17 04:05:43 +09:00
Yu Watanabe
2e59ba4e24
wait-online: several cleanups for LinkOperationalState
...
- fix memleak in parser,
- fix missing return in parser on failure,
- drop unnecessary temporary argument in command line argument parser,
- use recently introduced macros and helper functions.
2024-01-17 04:05:43 +09:00
Yu Watanabe
2278d9f66e
network: several cleanups for LinkOperationalState
...
- introduce link_required_operstate_for_online() helper function,
- use recently introduced macros and helper functions,
- unconditionally serialize the minimum and maximum of required
operational state.
2024-01-17 04:05:43 +09:00
Yu Watanabe
ba04f957fe
network: drop unnecessary temporary variables
2024-01-17 04:05:43 +09:00
Yu Watanabe
47420573a7
network/route: find/distinguish routes in the same way that the kernel uses
...
The kernel uses different logics to find or distinguish IPv4 and IPv6 routes.
Let's follow the same way that the kernel uses.
See comments in the code for more details.
2024-01-16 16:13:53 +00:00
Yu Watanabe
b9b5096edb
network/queue: detach request from the queue only when the request is actually queued
...
No effective functionality is changed in this commit.
Refactoring and preparation for later commits.
2024-01-16 23:25:32 +09:00
Yu Watanabe
e30dc59c2e
network/queue: increase the reference counter of the request before processing it
...
To prevent the request freed in req->process().
This also makes a request that is not requested by a link detached on failure.
Otherwise, the request may periodically processed and failed forever.
2024-01-16 23:25:32 +09:00
Luca Boccassi
c5ff54c40f
Merge pull request #30953 from yuwata/network-nexthop-silently-removed-by-kernel
...
network/nexthop: forget nexthops silently removed by kernel
2024-01-16 12:39:46 +00:00
Yu Watanabe
3518ff4a42
network/route: introduce route_get_link() and use it in log_route_debug()
...
No functional change, just refactoring and preparation for later
commits.
2024-01-16 12:35:58 +00:00
Yu Watanabe
3cbbe8635a
network/nexthop: drop dependent nexthops on removal
...
If a nexthop is removed, dependent nexthops are silently removed by the
kernel. Hence, networkd may be confused that nexthops that depends on the
nexthop still exist, and may fail to configure other routes or so.
2024-01-16 12:48:50 +09:00
Yu Watanabe
531c724682
network/nexthop: introduce a reverse map of nexthop group members
...
It is not used in this commit, but will be used later.
Preparation for later commits.
2024-01-16 12:48:50 +09:00
Yu Watanabe
4e9795ebfa
network/nexthop: read netlink message in nexthop_update_group()
...
No functional change, preparation for later commits.
2024-01-16 12:48:50 +09:00
Yu Watanabe
04a25cc425
network/nexthop: reorder elements in NextHop
2024-01-16 12:48:50 +09:00
Yu Watanabe
0a94e19c72
network/route: trivial cosmetic changes
...
- downgrade log level,
- add short comment for boolean argument.
2024-01-16 11:45:14 +09:00
Yu Watanabe
0013863972
network/route: reorder getters in manager_rtnl_process_route()
...
No functional change, just refactoring and preparation for later
commits.
2024-01-16 11:02:55 +09:00
Yu Watanabe
31b26dee4f
network/route: reorder setter called in route_set_netlink_message()
...
Also, this renames 'req' -> 'm', and makes the function unconditionally
set route type and route metric, and override type later if necessary.
Should not change any effective behavior. Just refactoring.
2024-01-16 11:02:55 +09:00
Yu Watanabe
e717b825d4
network/route: reorder elements in Route object and add comments
2024-01-16 11:02:55 +09:00
Yu Watanabe
1bcd7cd0e7
network/route: relocate route_new() and friends
...
No functional change, preparation for later commits.
2024-01-16 11:02:55 +09:00
Luca Boccassi
01526fedef
Merge pull request #30934 from yuwata/network-introduce-route-nexthop
...
network/route: introduce RouteNextHop object
2024-01-15 14:41:58 +00:00
Yu Watanabe
c2eb7753dd
network/link: automatically reconfigure interface on failure
...
Closes #29246 .
2024-01-15 15:46:33 +09:00
Yu Watanabe
24b9c341ce
network/link: shorten code a bit
2024-01-15 15:46:33 +09:00
Yu Watanabe
13efe0ab11
network/route: do not read RTA_OIF twice
...
It is also read in route_nexthops_read_netlink_message(), and already
stored in the Route object. Let's use it.
2024-01-15 10:28:25 +09:00
Yu Watanabe
b9e1caf64a
network/route-nexthop: store ifindex of the assigned interface in Route.nexthop.ifindex
...
And use it if set on building netlink message.
2024-01-15 10:28:25 +09:00
Yu Watanabe
054b8c2817
network/route: also use RouteNextHop for managing gateway
...
No functional change, just refactoring.
2024-01-15 10:28:25 +09:00
Yu Watanabe
fea879cd04
network/route-nexthop: introduce struct RouteNextHop and replace MultipathRoute with it
...
It is mostly equivalent to MultipathRoute. So, no functional change,
just refactoring and preparation for later commits.
2024-01-15 10:28:25 +09:00
Yu Watanabe
a0ab69d062
network/route-nexthop: make multipath_route_get_link() take fallback link
...
No functional change, just refactoring.
2024-01-14 06:04:46 +09:00
Yu Watanabe
fad2f72351
network/route-nexthop: do not update MultipathRoute object
...
A MultipathRoute object is always owned by a Network object, and the
interface matching with its name specified in a MultipathRoute= setting
may be removed, and re-added later with a different ifindex.
2024-01-14 06:04:46 +09:00
Yu Watanabe
c23f957eb1
network/route-nexthop: split out route_nexthops_is_ready_to_configure()
...
No effective functionality changed, just refactoring and preparation for
later commits.
2024-01-14 06:04:46 +09:00
Yu Watanabe
f47d38c6fc
network/route-nexthop: split out route_nexthops_to_string()
...
And reorder elements shown in the debugging log.
No effective functionality changed, just refactoring.
2024-01-14 06:04:46 +09:00
Yu Watanabe
54f9fba5e6
network/route-nexthop: split out netlink message handling for route nexthops
...
No functional change, just refactoring and preparation for later
commits.
2024-01-14 06:04:23 +09:00
Yu Watanabe
4db8ccbb59
wireguard: verify routes configured in .netdev file
...
Then, scope and friends are correctly adjusted, and the behavior should
be matched when the same route is configured in .network file.
2024-01-13 10:10:32 +09:00
Yu Watanabe
0db96961b4
network/route: split out route_section_verify_nexthops()
...
No effective functional change, just refactoring and preparation for
later commits.
2024-01-13 10:10:32 +09:00
Yu Watanabe
b9f29e9f52
network/route: relocate route_type_is_reject() and friends
...
No functional change, preparation for later commits.
2024-01-13 10:10:32 +09:00
Yu Watanabe
b82697eb20
Merge pull request #30895 from yuwata/network-drop-object-even-on-fail
...
network: remove Address object even when we failed to remove relevant address
2024-01-13 09:03:07 +09:00
Luca Boccassi
f60c964535
Merge pull request #30897 from yuwata/network-route-expiration
...
network: several cleanups for route expiration handling
2024-01-12 23:32:12 +00:00
Luca Boccassi
c9eb59e710
Merge pull request #30896 from yuwata/network-route-conf-parser
...
network: minor cleanups for conf parsers
2024-01-12 23:27:39 +00:00
Lennart Poettering
91b34c7641
networkd: expose the nsid in the GetNamespaceId() varlink call
...
Let's return both ids in the GetNamespaceID(), since they are pretty
much the same concept.
2024-01-12 21:43:34 +01:00
Lennart Poettering
535252dc26
networkd: expose nsid via dbus
2024-01-12 21:43:34 +01:00
Yu Watanabe
be89a76a46
network/ndisc: do not try to set too large value for ICMP ratelimting
...
Follow-up for 6197db53ba .
When we set too large value, the kernel just refuse it. So, this does
not change the net behavior.
Prompted by https://github.com/systemd/systemd/pull/30490#discussion_r1449477125 .
2024-01-12 14:38:30 +00:00
Yu Watanabe
ffad01c81e
network/route-nexthop: always reset gateway address when _dhcp or friends is specified to Gateway=
...
Just for safety.
2024-01-12 16:03:37 +09:00
Yu Watanabe
dd0385c1f2
network/dhcp4: use route_configure_handler_internal() at one more place
2024-01-12 09:46:09 +09:00
Yu Watanabe
2c0b49baab
network/route: update expiration timer only when we know the route exists
2024-01-12 09:46:09 +09:00
Yu Watanabe
14436bf523
network/route: save if the route expiration is managed by the kernel
...
Otherwise, our own expiration timer will be setup on updating a route.
See comment in link_request_route().
2024-01-12 09:46:09 +09:00
Yu Watanabe
f86575ca06
network/route: unconditionally call route_setup_timer() for managed routes
...
For foreign routes, we do not set lifetime, as it is foreign.
So, this should not change any behavior. Preparation for later commits.
2024-01-12 09:46:09 +09:00
Yu Watanabe
a5a0a4eb56
network/route: use specified error message
...
Previously, specified error message was not used.
2024-01-12 09:46:09 +09:00
Yu Watanabe
4207f6c05d
network/route-nexthop: make GatewayOnLink= support an empty string
...
And invalidate the route section if an invalid string is specified.
2024-01-12 09:44:03 +09:00
Yu Watanabe
4444c2baf5
network/route: move two more conf parsers to networkd-route-nexthop.[ch]
...
Let's manage nexthop (gateway) handling in networkd-route-nexthop.[ch].
2024-01-12 09:44:03 +09:00
Yu Watanabe
62c6f9f7ac
network/nexthop: drop NextHop object even if we fail to remove the nexthop
2024-01-12 09:36:04 +09:00