Skip to content

Conversation

@nickgarlis
Copy link
Contributor

ResetSetElements resets the stateful expressions (e.g., counters) of all elements in the specified set. The reset is applied immediately (no Flush is required) and the returned elements reflect their state prior to the reset. This update also adds a reset flag to the internal getSetElements method, along with a safeguard for situations where the user provides no valid set identifier.

Also, many thanks for the prior reviews!

ResetSetElements resets the stateful expressions (e.g., counters) of all
elements in the specified set. The reset is applied immediately
(no Flush is required) and the returned elements reflect their state
prior to the reset. This update also adds a reset flag to the internal
getSetElements method, along with a safeguard for situations where the
user provides no valid set identifier.
@nickgarlis nickgarlis force-pushed the add-get-setelem-reset branch from 56ec7cb to df1ed79 Compare November 18, 2025 18:44
flags := netlink.Request
attrs := []netlink.Attribute{
{Type: unix.NFTA_SET_ELEM_LIST_TABLE, Data: []byte(s.Table.Name + "\x00")},
{Type: unix.NFTA_SET_ELEM_LIST_SET, Data: []byte(s.Name + "\x00")},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one was accidentally duplicated in the if statement below but luckily it didn't cause any bugs

@stapelberg stapelberg merged commit 1db35da into google:main Nov 19, 2025
2 checks passed
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.

2 participants