Skip to content

Commit eb21f89

Browse files
committed
Linux: Fix ruff errors
1 parent 2fa0ce8 commit eb21f89

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

volatility3/framework/plugins/linux/netfilter.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ def _run(self) -> Iterator[Tuple[int, str, str, int, int, str, bool]]:
204204
module_name [str]: Linux kernel module name
205205
hooked [bool]: "True" if the network stack has been hijacked
206206
"""
207-
for netns, net in self.get_net_namespaces():
207+
for netns, network in self.get_net_namespaces():
208208
for proto_idx, proto_name, hook_idx, hook_name in self._proto_hook_loop():
209-
hooks_container = self.get_hooks_container(net, proto_name, hook_name)
209+
hooks_container = self.get_hooks_container(
210+
network, proto_name, hook_name
211+
)
210212

211213
for hook_container in hooks_container:
212214
for hook_ops in self.get_hook_ops(
@@ -311,9 +313,9 @@ def get_net_namespaces(self):
311313
"""
312314
nethead = self.vmlinux.object_from_symbol("net_namespace_list")
313315
symbol_net_name = self.get_symbol_fullname("net")
314-
for net in nethead.to_list(symbol_net_name, "list"):
315-
net_ns_id = net.ns.inum
316-
yield net_ns_id, net
316+
for network in nethead.to_list(symbol_net_name, "list"):
317+
net_ns_id = network.ns.inum
318+
yield net_ns_id, network
317319

318320
def get_hooks_container(self, net, proto_name, hook_name):
319321
"""Returns the data structure used in a specific kernel implementation to store

volatility3/framework/plugins/linux/sockstat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ def _build_network_devices_map(self, netns_id: int) -> Dict:
7373
netdevices_map = {}
7474
nethead = self._vmlinux.object_from_symbol(symbol_name="net_namespace_list")
7575
net_symname = self._vmlinux.symbol_table_name + constants.BANG + "net"
76-
for net in nethead.to_list(net_symname, "list"):
76+
for network in nethead.to_list(net_symname, "list"):
7777
net_device_symname = (
7878
self._vmlinux.symbol_table_name + constants.BANG + "net_device"
7979
)
8080
for net_dev in net.dev_base_head.to_list(net_device_symname, "dev_list"):
8181
if (
8282
isinstance(netns_id, NotAvailableValue)
83-
or net.get_inode() != netns_id
83+
or network.get_inode() != netns_id
8484
):
8585
continue
8686
dev_name = utility.array_to_string(net_dev.name)

volatility3/framework/symbols/linux/extensions/net.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import logging
2-
from typing import Dict, List
2+
from typing import Dict, List, Optional
33

44
from volatility3.framework import objects, exceptions, renderers, interfaces, constants
55
from volatility3.framework.objects import utility

0 commit comments

Comments
 (0)