Skip to content

Commit 2edcc1e

Browse files
authored
Merge pull request FRRouting#19807 from anlancs/fix/zebra-fpm
zebra: fix missing fpm messages
2 parents c91e105 + c01a2bc commit 2edcc1e

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

tests/topotests/fpm_testing_topo1/test_fpm_topo1.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,63 @@ def test_fpm_install_routes():
129129
assert success, "Unable to remove 10000 routes: {}".format(result)
130130

131131

132+
def test_fpm_conneted_and_local_routes():
133+
"Test that conneted and local routes"
134+
135+
tgen = get_topogen()
136+
router = tgen.gears["r1"]
137+
138+
# Let's check added routes
139+
router_count = 1
140+
router.vtysh_cmd(
141+
"""
142+
configure terminal
143+
interface r1-eth0
144+
ip address 10.10.10.10 peer 10.10.10.11/24
145+
"""
146+
)
147+
148+
def check_r1_connected_routes():
149+
output = router.run(
150+
"pkill -SIGUSR1 fpm_listener; grep '10.10.10.0/24' /tmp/fpm_test.data | wc -l"
151+
)
152+
return int(output)
153+
154+
def check_r1_local_routes():
155+
output = router.run(
156+
"pkill -SIGUSR1 fpm_listener; grep '10.10.10.10/32' /tmp/fpm_test.data | wc -l"
157+
)
158+
return int(output)
159+
160+
success, result = topotest.run_and_expect(
161+
check_r1_connected_routes, router_count, count=30, wait=1
162+
)
163+
assert success, f"Failed to find {result} connected routes"
164+
success, result = topotest.run_and_expect(
165+
check_r1_local_routes, router_count, count=30, wait=1
166+
)
167+
assert success, f"Failed to find {result} local routes"
168+
169+
# Let's check removed routes
170+
router_count = 0
171+
router.vtysh_cmd(
172+
"""
173+
configure terminal
174+
interface r1-eth0
175+
no ip address 10.10.10.10 peer 10.10.10.11/24
176+
"""
177+
)
178+
179+
success, result = topotest.run_and_expect(
180+
check_r1_connected_routes, router_count, count=30, wait=1
181+
)
182+
assert success, f"Failed to find {result} connected routes"
183+
success, result = topotest.run_and_expect(
184+
check_r1_local_routes, router_count, count=30, wait=1
185+
)
186+
assert success, f"Failed to find {result} local routes"
187+
188+
132189
if __name__ == "__main__":
133190
args = ["-s"] + sys.argv[1:]
134191
sys.exit(pytest.main(args))

zebra/zebra_rib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,7 @@ static void rib_process(struct route_node *rn)
14981498
rib_process_update_fib(zvrf, rn, old_fib, new_fib);
14991499
else if (new_fib)
15001500
rib_process_add_fib(zvrf, rn, new_fib);
1501-
else if (old_fib && !RIB_SYSTEM_ROUTE(old_fib))
1501+
else if (old_fib && !RIB_KERNEL_ROUTE(old_fib))
15021502
rib_process_del_fib(zvrf, rn, old_fib);
15031503

15041504
/* Remove all RE entries queued for removal */

0 commit comments

Comments
 (0)