From 9f40495e96ea4510550509d8734927cd20de999a Mon Sep 17 00:00:00 2001 From: pavel Date: Sat, 7 Mar 2026 12:08:54 +0200 Subject: [PATCH] 1208 --- files/nats_registration_listener.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/files/nats_registration_listener.py b/files/nats_registration_listener.py index 7b85adc..601502c 100644 --- a/files/nats_registration_listener.py +++ b/files/nats_registration_listener.py @@ -72,6 +72,14 @@ PRODUCT_TAG_SLUG = { # "fox200": "fox200-auto-upgrade-latest", } +# MACs to ignore completely when seen in registrations +IGNORE_MACS_RAW = [ + "AA:BB:CC:DD:EE:FF", + "D0:6C:37:00:D5:84", + "44:D1:FA:7E:3F:65", + "C4:93:00:4E:92:7C", +] + # Global counter for any NetBox-related problems NB_PROBLEM_COUNTER = 0 NB_PROBLEM_LOCK = asyncio.Lock() @@ -158,6 +166,9 @@ def normalize_mac(mac: str) -> Optional[str]: return None +IGNORE_MACS = {m for m in (normalize_mac(x) for x in IGNORE_MACS_RAW) if m} + + def http_get_json(url: str, params: Optional[Dict[str, str]] = None, headers: Optional[Dict[str, str]] = None, timeout: float = NB_TIMEOUT): if params: url = f"{url}?{urlencode(params)}" @@ -426,6 +437,16 @@ async def main(): except Exception: pass + mac_norm = normalize_mac(mac) + if mac_norm in IGNORE_MACS: + async with print_lock: + print( + f"[{ts()}] ignoring registration for mac={mac}", + file=sys.stdout, + flush=True, + ) + return + host_suffix = "" action_suffix = "" # kept; not used bell_prefix = "" # ASCII BEL when action_next present (3x)