Skip to content

Real-time network monitor + outbound firewall — see & block every connection. Privacy-first, local-first, Rust fleet agent, SIEM exports, 8 languages. / Moniteur réseau temps réel + pare-feu sortant, agent de flotte Rust, exports SIEM. 100 % local.

Fix DHCP pending-name wipe when option 12 is absent

MoneyLisa45c12254936b
diff --git a/backend/api/main.py b/backend/api/main.py
index e301d68..2df00b7 100644
--- a/backend/api/main.py
+++ b/backend/api/main.py
@@ -437,6 +437,14 @@ def _learn_dhcp_name(hostname: str, req_ip: Optional[str], mac: str,
Si l'appareil est déjà connu (par IP demandée ou MAC), on le nomme ;
sinon on retient le couple MAC→nom pour la prochaine découverte.
"""
+ # EN: A DHCP message may carry a requested IP but NO option 12 — bail
+ # out early, otherwise the empty name would overwrite a real one
+ # already stored in _pending_mac_names (name learned then lost).
+ # FR: Un message DHCP peut porter une IP demandée mais PAS d'option 12 —
+ # sortir tôt, sinon le nom vide écraserait un vrai nom déjà stocké
+ # dans _pending_mac_names (nom appris puis perdu).
+ if not hostname:
+ return
if req_ip and is_private(req_ip):
_learn_lan_hostname(req_ip, hostname, touched_devices)
return