diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e1c889ef..1fd4396b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,7 @@ All notable changes to the `python-openflow` project are documented in this file Fixed ===== - Added missing ``ActionPopMPLS.length`` attribute to fix ``PackException`` when packing objects. +- Correct return value for ``get_size()`` when used with ``ActionHeader`` objects directly (useful for TableFeatures Properties). [2025.1.0] - 2025-04-14 *********************** diff --git a/pyof/v0x04/common/action.py b/pyof/v0x04/common/action.py index c0af066c..80252e21 100644 --- a/pyof/v0x04/common/action.py +++ b/pyof/v0x04/common/action.py @@ -112,6 +112,8 @@ def get_size(self, value=None): """Return the action length including the padding (multiple of 8).""" if isinstance(value, ActionHeader): return value.get_size() + if self.__class__ == ActionHeader: + return super().get_size() if value is None: current_size = super().get_size() return ceil(current_size / 8) * 8