Skip to content
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: crash when deleting a vrf with a l3vni inside #12123

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions zebra/zebra_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,8 @@ struct zebra_evpn *zebra_evpn_add(vni_t vni)
struct zebra_evpn *zevpn = NULL;

zvrf = zebra_vrf_get_evpn();
if (!zvrf->evpn_table)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this check before memset (a little bit above)?

return NULL;
memset(&tmp_zevpn, 0, sizeof(tmp_zevpn));
tmp_zevpn.vni = vni;
zevpn = hash_get(zvrf->evpn_table, &tmp_zevpn, zebra_evpn_alloc);
Expand Down
3 changes: 3 additions & 0 deletions zebra/zebra_vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2176,6 +2176,8 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,
return 0;

zevpn = zebra_evpn_add(vni);
if (!zevpn)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be NULL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can, in the case where the hash table is not present.

return -1;

/* Find bridge interface for the VNI */
vlan_if = zvni_map_to_svi(vxl->access_vlan,
Expand Down Expand Up @@ -5913,6 +5915,7 @@ void zebra_vxlan_close_tables(struct zebra_vrf *zvrf)
return;
hash_iterate(zvrf->evpn_table, zebra_evpn_vxlan_cleanup_all, zvrf);
hash_free(zvrf->evpn_table);
zvrf->evpn_table = NULL;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, why this pull request was closed? I seem to have encountered the same problem

if (zvrf->vxlan_sg_table) {
zebra_vxlan_cleanup_sg_table(zvrf);
hash_free(zvrf->vxlan_sg_table);
Expand Down