-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zebra: Fix to avoid two Vrfs with same table ids #16350
zebra: Fix to avoid two Vrfs with same table ids #16350
Conversation
Testing Without Fix:
With Fix:
|
4e94167
to
bb033c2
Compare
@Mergifyio backport dev/10.1 stable/10.0 stable/9.1 stable/9.0 |
✅ Backports have been created
|
bb033c2
to
a80298a
Compare
ci:rerun |
1 similar comment
ci:rerun |
zebra/interface.c
Outdated
|
||
if (strcmp(name, vrf->name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vrf
can be null, so... segfault is guaranteed here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies; our internal code has the vrf NULL check missing, so I directly did strcmp.
I added the check appropriately now.
a80298a
to
e03cba8
Compare
ci:rerun |
During internal testing, when the following sequence is followed, two non default vrfs end up pointing to the same table-id - Initially vrf201 has table id 1002 - ip link add dev vrf202 type vrf table 1002 - ip link set dev vrf202 up - ip link set dev <intrerface> master vrf202 This will ideally lead to zebra exit since this is a misconfiguration as expected. However if we perform a restart frr.service at this point, we end up having two vrfs pointing to same table-id and bad things can happen. This is because in the interface_vrf_change, we incorrectly check for vrf_lookup_by_id() to evaluate if there is a misconfig. This works well for a non restart case but not for the startup case. root@mlx-3700-20:mgmt:/var/log/frr# sudo vtysh -c "sh vrf" vrf mgmt id 37 table 1001 vrf vrf201 id 46 table 1002 vrf vrf202 id 59 table 1002 >>>> Fix: in all cases of misconfiguration, exit zebra as expected. Ticket :#3970414 Signed-off-by: Donald Sharp <[email protected]> Signed-off-by: Rajasekar Raja <[email protected]>
e03cba8
to
c77e157
Compare
zebra: Fix to avoid two Vrfs with same table ids (backport #16350)
zebra: Fix to avoid two Vrfs with same table ids (backport #16350)
zebra: Fix to avoid two Vrfs with same table ids (backport #16350)
During internal testing, when the following sequence is followed, two non default vrfs end up pointing to the same table-id
This will ideally lead to zebra exit since this is a misconfiguration as expected.
However if we perform a restart frr.service at this point, we end up having two vrfs pointing to same table-id and bad things can happen.
root@mlx-3700-20:mgmt:/var/log/frr# sudo vtysh -c "sh vrf" vrf mgmt id 37 table 1001
vrf vrf201 id 46 table 1002
vrf vrf202 id 59 table 1002 >>>>
Fix: in all cases of misconfiguration, exit zebra as expected.
Ticket :#3970414