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

cnetlink: clone objects to ensure they are unchanged #442

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

KanjiMonster
Copy link
Contributor

Libnl ops that support updating objects may modify the object, even if we haven't handled the notification yet, causing older stored notifications to use an object "from the future".

Avoid this by cloning the new object. Both nl_object_clone() and nl_object_put() are NULL-safe, so we don't need to do any nullptr checks.

Libnl ops that support updating objects may modify the object, even if
we haven't handled the notification yet, causing older stored
notifications to use an object "from the future".

Avoid this by cloning the new object. Both nl_object_clone() and
nl_object_put() are NULL-safe, so we don't need to do any nullptr
checks.

Signed-off-by: Jonas Gorski <[email protected]>
@KanjiMonster
Copy link
Contributor Author

KanjiMonster commented Jun 4, 2024

Depends on bisdn/meta-bisdn-linux#215, else it will crash with bridges or bonds

@KanjiMonster KanjiMonster marked this pull request as ready for review June 4, 2024 15:11
Copy link
Contributor

@rubensfig rubensfig left a comment

Choose a reason for hiding this comment

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

Reviewed and tested

@rubensfig rubensfig merged commit 5bc695a into main Jun 7, 2024
4 checks passed
@rubensfig rubensfig deleted the jogo_cnetlink_clone branch June 7, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants