From f4c85539882ddb8410cca57255685b31c5be5812 Mon Sep 17 00:00:00 2001 From: l0crian1 Date: Sun, 20 Apr 2025 21:19:56 -0400 Subject: t7268: Add op-mode command for show all interfaces on system lo address was an edge case and needed to be handled. --- src/op_mode/interfaces.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/op_mode/interfaces.py b/src/op_mode/interfaces.py index 9963a9651..23ec27d5b 100755 --- a/src/op_mode/interfaces.py +++ b/src/op_mode/interfaces.py @@ -346,12 +346,13 @@ def _format_kernel_data(data, detail): has_global = False for ip in interface['addr_info']: - if ip.get('scope') == 'global': + if ip.get('scope') in ('global', 'host'): has_global = True local = ip.get('local', '-') prefixlen = ip.get('prefixlen', '') ip_list.append(f"{local}/{prefixlen}") + # If no global IP address, add '-'; indicates no IP address on interface if not has_global: ip_list.append('-') -- cgit v1.2.3