bisdn / basebox

A tiny OpenFlow controller for OF-DPA switches.
Mozilla Public License 2.0
45 stars 9 forks source link

cnetlink: clone objects to ensure they are unchanged #442

Closed KanjiMonster closed 3 months ago

KanjiMonster commented 3 months ago

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.

KanjiMonster commented 3 months ago

Depends on https://github.com/bisdn/meta-switch/pull/215, else it will crash with bridges or bonds