From 84b678cd786c1c8825e748c5b25e377f95035dc5 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Mon, 1 Jun 2026 21:00:40 +0200 Subject: [PATCH] confignet: Fix interface type detection for IB VFs IB VFs have the following "ip l" output: 4: ibp129s0: mtu 2044 qdisc mq state UP mode DEFAULT group default qlen 1000 link/infiniband 00:00:00:8d:fe:80:00:00:00:00:00:00:60:5e:65:03:00:2c:43:c8 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff vf 0 link/infiniband 00:00:00:8d:fe:80:00:00:00:00:00:00:60:5e:65:03:00:2c:43:c8 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff, spoof checking off, NODE_GUID 00:00:00:00:00:00:00:00, PORT_GUID 00:00:00:00:00:00:00:00, link-state enable, trust off, query_rss off 5: eno1: mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether 30:56:0f:17:c0:b4 brd ff:ff:ff:ff:ff:ff altname enp196s0 altname enx30560f17c0b4 This breaks the detection script because index 0 of the "vf 0 ..." line is not link/ anymore. This commit improves the detection logic to fix this. --- .../common/profile/scripts/confignet | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index 4a922b57..fc1db3ac 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -80,14 +80,18 @@ def await_tentative(): time.sleep(1) def map_idx_to_name(): - map = {} + map_dict = {} devtype = {} prevdev = None + for line in subprocess.check_output(['ip', 'l']).decode('utf8').splitlines(): - if line.startswith(' ') and 'link/' in line: - typ = line.split()[0].split('/')[1] - devtype[prevdev] = typ if typ != 'ether' else 'ethernet' if line.startswith(' '): + if 'link/' in line and prevdev and prevdev not in devtype: + for word in line.split(): + if word.startswith('link/'): + typ = word.split('/')[1] + devtype[prevdev] = typ if typ != 'ether' else 'ethernet' + break # Stop detection after the first type hit continue idx, iface, rst = line.split(':', 2) prevdev = iface.strip() @@ -99,9 +103,8 @@ def map_idx_to_name(): pass idx = int(idx) iface = iface.strip() - map[idx] = iface - return map, devtype - + map_dict[idx] = iface + return map_dict, devtype def get_interface_name(iname, settings): explicitname = settings.get('interface_names', None)