Parcourir la source

IPv4: Don't discard from unspecified src addresses

bjoernQ il y a 1 an
Parent
commit
74fd2aeeb6
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      src/iface/interface/ipv4.rs

+ 3 - 3
src/iface/interface/ipv4.rs

@@ -18,9 +18,9 @@ impl InterfaceInner {
         frag: &'a mut FragmentsBuffer,
     ) -> Option<IpPacket<'a>> {
         let ipv4_repr = check!(Ipv4Repr::parse(ipv4_packet, &self.caps.checksum));
-        if !self.is_unicast_v4(ipv4_repr.src_addr) {
-            // Discard packets with non-unicast source addresses.
-            net_debug!("non-unicast source address");
+        if !self.is_unicast_v4(ipv4_repr.src_addr) && !ipv4_repr.src_addr.is_unspecified() {
+            // Discard packets with non-unicast source addresses but allow unspecified
+            net_debug!("non-unicast or unspecified source address");
             return None;
         }