2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-09 17:42:31 +00:00

Change name to index in apiclient

confignet was using the index for ipv4
This commit is contained in:
Jarrod Johnson
2025-12-12 11:18:33 -05:00
parent 31c1a865dc
commit a4229fc58d

View File

@@ -132,7 +132,8 @@ def get_ifaddrs():
if family == socket.AF_INET:
addr_ptr = ctypes.cast(ifa.contents.ifa_addr, ctypes.POINTER(sockaddr_in))
addr_bytes = bytes(addr_ptr.contents.sin_addr)
addresses.append(('ip', family, addr_bytes, name))
if_index = socket.if_nametoindex(name) if name else 0
addresses.append(('ip', family, addr_bytes, if_index))
elif family == socket.AF_INET6:
addr_ptr = ctypes.cast(ifa.contents.ifa_addr, ctypes.POINTER(sockaddr_in6))
addr_bytes = bytes(addr_ptr.contents.sin6_addr)