From 4a417a94fdd839c8dc030c8d863f4044fd55311e Mon Sep 17 00:00:00 2001 From: ParrotXray Date: Fri, 29 May 2026 04:05:45 +0000 Subject: [PATCH] fix: catch subnet-directed broadcast in is_non_unicast guard --- mantis/src/detection/ml/server_ports.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mantis/src/detection/ml/server_ports.rs b/mantis/src/detection/ml/server_ports.rs index 050d89a..e616c97 100644 --- a/mantis/src/detection/ml/server_ports.rs +++ b/mantis/src/detection/ml/server_ports.rs @@ -124,11 +124,12 @@ pub fn is_non_unicast(ip: &str) -> bool { }; match addr { IpAddr::V4(v4) => { - v4.is_multicast() // 224.0.0.0/4 - || v4.is_broadcast() // 255.255.255.255 - || v4.is_loopback() // 127.0.0.0/8 - || v4.is_unspecified() // 0.0.0.0 - || v4.is_link_local() // 169.254.0.0/16 + v4.is_multicast() // 224.0.0.0/4 + || v4.is_broadcast() // 255.255.255.255 + || v4.is_loopback() // 127.0.0.0/8 + || v4.is_unspecified() // 0.0.0.0 + || v4.is_link_local() // 169.254.0.0/16 + || v4.octets()[3] == 255 // subnet-directed broadcast (x.x.x.255) } IpAddr::V6(v6) => { v6.is_multicast() // ff00::/8