mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
Fixed using 169.254/16 as a valid IP for notifying to broker
This commit is contained in:
parent
2d942fbac7
commit
f751fff8ca
@ -108,7 +108,7 @@ class CommonService(object):
|
|||||||
ids = ','.join([i.mac for i in netInfo])
|
ids = ','.join([i.mac for i in netInfo])
|
||||||
if ids == '':
|
if ids == '':
|
||||||
# Wait for any network interface to be ready
|
# Wait for any network interface to be ready
|
||||||
logger.debug('No network interfaces found, retrying in a while...')
|
logger.debug('No valid network interfaces found, retrying in a while...')
|
||||||
raise Exception()
|
raise Exception()
|
||||||
logger.debug('Ids: {}'.format(ids))
|
logger.debug('Ids: {}'.format(ids))
|
||||||
self.api.init(ids)
|
self.api.init(ids)
|
||||||
|
@ -62,7 +62,7 @@ def getNetworkInfo():
|
|||||||
for ip in obj.IPAddress:
|
for ip in obj.IPAddress:
|
||||||
if ':' in ip: # Is IPV6, skip this
|
if ':' in ip: # Is IPV6, skip this
|
||||||
continue
|
continue
|
||||||
if ip == '' or ip is None:
|
if ip is None or ip == '' or ip.startswith('169.254') or ip.startswith('0.'): # If single link ip, or no ip
|
||||||
continue
|
continue
|
||||||
# logger.debug('Net config found: {}=({}, {})'.format(obj.Caption, obj.MACAddress, ip))
|
# logger.debug('Net config found: {}=({}, {})'.format(obj.Caption, obj.MACAddress, ip))
|
||||||
yield utils.Bunch(name=obj.Caption, mac=obj.MACAddress, ip=ip)
|
yield utils.Bunch(name=obj.Caption, mac=obj.MACAddress, ip=ip)
|
||||||
|
Loading…
Reference in New Issue
Block a user