Skip to content

nl-cls-delete: tolerate NLE_OBJ_NOTFOUND from cascaded kernel deletion#454

Open
wxmzy88 wants to merge 1 commit intothom311:mainfrom
wxmzy88:main
Open

nl-cls-delete: tolerate NLE_OBJ_NOTFOUND from cascaded kernel deletion#454
wxmzy88 wants to merge 1 commit intothom311:mainfrom
wxmzy88:main

Conversation

@wxmzy88
Copy link

@wxmzy88 wxmzy88 commented Mar 26, 2026

When deleting a u32 classifier, the kernel cascades the deletion of child objects (hash tables and match rules) when the root node is removed via u32_destroy().
Since nl-cls-delete iterates a pre-fetched list of matching entries, subsequent rtnl_cls_delete() calls for already-removed children return -NLE_OBJ_NOTFOUND, which the current code treats as a fatal error.

Handle this by catching NLE_OBJ_NOTFOUND in delete_cb() and treating it as non-fatal.
These entries are reported as "Already removed (cascaded)" instead of triggering nl_cli_fatal(). The deleted counter only increments for entries that were actively deleted by this tool, not for entries that were already removed by the kernel as a side effect.

Before:
image

After:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant