2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-11 18:42:29 +00:00

Use IPv4 address for ikvm when fe80 is the local bmc

The fe80:: is hopeless, try to send ipv4 just in case.

Technically speaking, the user may be using a different address
or real ipv6 and the ipv4 guess might fail, but it probably won't.
This commit is contained in:
Jarrod Johnson
2025-04-15 14:25:03 -04:00
parent f11473c736
commit e27f07ac36
2 changed files with 6 additions and 0 deletions

View File

@@ -1669,6 +1669,9 @@ class IpmiHandler(object):
launchdata = self.ipmicmd.get_ikvm_launchdata()
if 'url' in launchdata and not launchdata['url'].startswith('https://'):
mybmc = self.ipmicmd.confluentbmcname
if mybmc.startswith('fe80::'): # link local, need to adjust
lancfg = self.ipmicmd.get_net_configuration()
mybmc = lancfg['ipv4_address'].split('/')[0]
if ':' in mybmc and not '[' in mybmc:
mybmc = '[{}]'.format(mybmc)
launchdata['url'] = 'https://{}{}'.format(mybmc, launchdata['url'])

View File

@@ -1526,6 +1526,9 @@ class IpmiHandler(object):
launchdata = self.ipmicmd.get_ikvm_launchdata()
if 'url' in launchdata and not launchdata['url'].startswith('https://'):
mybmc = self.ipmicmd.confluentbmcname
if mybmc.startswith('fe80::'): # link local, need to adjust
lancfg = self.ipmicmd.get_net_configuration()
mybmc = lancfg['ipv4_address'].split('/')[0]
if ':' in mybmc and not '[' in mybmc:
mybmc = '[{}]'.format(mybmc)
launchdata['url'] = 'https://{}{}'.format(mybmc, launchdata['url'])