2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 11:57:37 +00:00

Fix reply on nonfunctional nic

If a nic was up but without IPv4,
do not reply even if the kernel is
'helping' us to be in the ballpark.
This commit is contained in:
Jarrod Johnson 2020-05-29 17:32:45 -04:00
parent 2c1ca170e5
commit 116682082a
2 changed files with 5 additions and 0 deletions

View File

@ -469,6 +469,9 @@ def check_reply(node, info, packet, sock, cfg, reqview):
gateway = None
netmask = None
niccfg = netutil.get_nic_config(cfg, node, ifidx=info['netinfo']['ifidx'])
if niccfg.get('ipv4_broken', False):
# Received a request over a nic with no ipv4 configured, ignore it
return
clipn = None
if niccfg['ipv4_address']:
clipn = socket.inet_aton(niccfg['ipv4_address'])

View File

@ -177,6 +177,8 @@ def get_nic_config(configmanager, node, ip=None, mac=None, ifidx=None,
if ifidx is not None:
dhcprequested = False
nets = list(idxtonets(ifidx))
if not nets:
cfgdata['ipv4_broken'] = True
if serverip is not None:
needsvrip = True
dhcprequested = False