diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-08-04 10:59:50 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-08-05 02:15:15 +0200 |
commit | 0c7bb54238fd01520b2d8b8a25c30503d0c8fd7c (patch) | |
tree | 508a0b7cd05ab2601ce080f620966722f90d226b /src/network/networkd-route-util.c | |
parent | sleep: add HibernateOnACPower= option (#33846) (diff) | |
download | systemd-0c7bb54238fd01520b2d8b8a25c30503d0c8fd7c.tar.xz systemd-0c7bb54238fd01520b2d8b8a25c30503d0c8fd7c.zip |
network: split out core logic route_type_is_reject()
Preparation for later change.
Diffstat (limited to 'src/network/networkd-route-util.c')
-rw-r--r-- | src/network/networkd-route-util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/networkd-route-util.c b/src/network/networkd-route-util.c index 8d63b9b058..9bb1e0f707 100644 --- a/src/network/networkd-route-util.c +++ b/src/network/networkd-route-util.c @@ -39,10 +39,12 @@ unsigned routes_max(void) { return cached; } -bool route_type_is_reject(const Route *route) { - assert(route); +bool route_type_is_reject(uint8_t type) { + return IN_SET(type, RTN_UNREACHABLE, RTN_PROHIBIT, RTN_BLACKHOLE, RTN_THROW); +} - return IN_SET(route->type, RTN_UNREACHABLE, RTN_PROHIBIT, RTN_BLACKHOLE, RTN_THROW); +bool route_is_reject(const Route *route) { + return route_type_is_reject(ASSERT_PTR(route)->type); } static bool route_lifetime_is_valid(const Route *route) { |