fix: Bind to interface bug.

This commit is contained in:
lgandx 2014-03-20 22:37:10 -04:00
commit a1a4f46c7b

View file

@ -2108,25 +2108,40 @@ ThreadingTCPServer.allow_reuse_address = 1
def serve_thread_udp(host, port, handler):
try:
server = ThreadingUDPServer((host, port), handler)
server.serve_forever()
except:
print "Error starting UDP server on port " + str(port) + ". Check that you have the necessary permissions (i.e. root), no other servers are running and the correct network interface is set in Responder.conf."
try:
if OsInterfaceIsSupported(INTERFACE):
IP = FindLocalIP(BIND_TO_Interface)
server = ThreadingUDPServer((IP, port), handler)
server.serve_forever()
else:
server = ThreadingUDPServer((host, port), handler)
server.serve_forever()
except:
print "Error starting UDP server on port " + str(port) + ". Check that you have the necessary permissions (i.e. root), no other servers are running and the correct network interface is set in Responder.conf."
def serve_thread_tcp(host, port, handler):
try:
server = ThreadingTCPServer((host, port), handler)
server.serve_forever()
except:
print "Error starting TCP server on port " + str(port) + ". Check that you have the necessary permissions (i.e. root), no other servers are running and the correct network interface is set in Responder.conf."
try:
if OsInterfaceIsSupported(INTERFACE):
IP = FindLocalIP(BIND_TO_Interface)
server = ThreadingTCPServer((IP, port), handler)
server.serve_forever()
else:
server = ThreadingTCPServer((host, port), handler)
server.serve_forever()
except:
print "Error starting TCP server on port " + str(port) + ". Check that you have the necessary permissions (i.e. root), no other servers are running and the correct network interface is set in Responder.conf."
def serve_thread_SSL(host, port, handler):
try:
server = SSlSock((host, port), handler)
server.serve_forever()
except:
print "Error starting TCP server on port " + str(port) + ". Check that you have the necessary permissions (i.e. root), no other servers are running and the correct network interface is set in Responder.conf."
try:
if OsInterfaceIsSupported(INTERFACE):
IP = FindLocalIP(BIND_TO_Interface)
server = SSlSock((IP, port), handler)
server.serve_forever()
else:
server = SSlSock((host, port), handler)
server.serve_forever()
except:
print "Error starting TCP server on port " + str(port) + ". Check that you have the necessary permissions (i.e. root), no other servers are running and the correct network interface is set in Responder.conf."
def main():
try:
@ -2160,3 +2175,4 @@ if __name__ == '__main__':