Skip to content
Snippets Groups Projects
Commit 77a4421e authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

fix bug

parent f90db663
Branches
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ while True:
print("Connected successfully!")
break # Exit loop once connected
except (socket.error, ConnectionRefusedError) as e:
print(f"Connection failed: {e}. Retrying in 2 seconds...")
# print(f"Connection failed: {e}. Retrying in 2 seconds...")
time.sleep(2) # Wait before retrying
......
......@@ -3,6 +3,7 @@ import struct
import time
import json
import subprocess
from scapy.all import get_if_hwaddr
from pathlib import Path
......@@ -92,7 +93,7 @@ def update_ospf_rule(input_map, total_router):
def setup_network():
global client_socket
mac_address = if_utils.get_if_hwaddr("ens3") # Example: "00:1A:2B:3C:4D:5E"
mac_address = get_if_hwaddr("ens3") # Example: "00:1A:2B:3C:4D:5E"
mac_bytes = bytes.fromhex(mac_address.replace(":", ""))
message = struct.pack('!6s', mac_bytes)
client_socket.sendall(message)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment