2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Provide error about in-use dhcp

The events will more clearly indicate
when dnsmasq is not adequately configured.
This commit is contained in:
Jarrod Johnson 2022-01-12 09:27:49 -05:00
parent 2d95fb1d74
commit f46fc9f7de

View File

@ -345,7 +345,11 @@ def snoop(handler, protocol=None, nodeguess=None):
net4.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
net4.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
net4.setsockopt(socket.IPPROTO_IP, IP_PKTINFO, 1)
net4.bind(('', 67))
try:
net4.bind(('', 67))
except Exception:
log.log({'error': 'Unable to bind DHCP server port, if using dnsmasq, specify bind-dynamic in dnsmasq.conf and restart dnsmasq and then confluent'})
return
v6addr = socket.inet_pton(socket.AF_INET6, mcastv6addr)
net6 = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
net6.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)