From fb231ea57d2b0f27695182470b8bc4de22be11c7 Mon Sep 17 00:00:00 2001 From: Andrew Case Date: Sat, 1 Mar 2025 14:07:10 -0600 Subject: [PATCH] Convert get_net_namespace_id to the proper convention --- .../framework/symbols/linux/extensions/network.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/volatility3/framework/symbols/linux/extensions/network.py b/volatility3/framework/symbols/linux/extensions/network.py index ed739894d..2e7271eac 100644 --- a/volatility3/framework/symbols/linux/extensions/network.py +++ b/volatility3/framework/symbols/linux/extensions/network.py @@ -199,7 +199,7 @@ class net_device(objects.StructType): """ return self.flags & self._get_net_device_flag_value("IFF_PROMISC") != 0 - def get_net_namespace_id(self) -> int: + def _do_get_net_namespace_id(self) -> int: """Return the network namespace id for this network interface. Returns: @@ -216,6 +216,17 @@ class net_device(objects.StructType): return net_ns_id + def get_net_namespace_id(self) -> Optional[int]: + """Return the network namespace id for this network interface. + + Returns: + int: the network namespace id for this network interface + """ + try: + return self._do_get_net_namespace_id() + except exceptions.InvalidAddressException: + return None + def get_operational_state(self) -> Union[str, interfaces.renderers.BaseAbsentValue]: """Return the netwok device oprational state (RFC 2863) string