Skip to content

Commit 83abec7

Browse files
yuwatabluca
authored andcommitted
network/route: fix reachability check when peer address is specified
When an address with peer address is specified, the kernel by default adds the prefix route for the peer address. When ManageForeignRoute=no is set, then we also needs to check the prefix for the peer address. Fixes #30403. (cherry picked from commit e091ed4) (cherry picked from commit b641ced) (cherry picked from commit 752b9b0) (cherry picked from commit be2c9ed)
1 parent fbf524b commit 83abec7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/network/networkd-route-util.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ bool gateway_is_ready(Link *link, bool onlink, int family, const union in_addr_u
152152
continue;
153153
if (FLAGS_SET(a->flags, IFA_F_NOPREFIXROUTE))
154154
continue;
155-
if (in_addr_is_set(a->family, &a->in_addr_peer))
156-
continue;
157-
if (in_addr_prefix_covers(family, &a->in_addr, a->prefixlen, gw) > 0)
155+
if (in_addr_prefix_covers(a->family,
156+
in_addr_is_set(a->family, &a->in_addr_peer) ? &a->in_addr_peer : &a->in_addr,
157+
a->prefixlen, gw) > 0)
158158
return true;
159159
}
160160

0 commit comments

Comments
 (0)