浏览代码

IPv4: Don't discard from unspecified src addresses

bjoernQ 1 年之前
父节点
当前提交
74fd2aeeb6
共有 1 个文件被更改,包括 3 次插入3 次删除
  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,
         frag: &'a mut FragmentsBuffer,
     ) -> Option<IpPacket<'a>> {
     ) -> Option<IpPacket<'a>> {
         let ipv4_repr = check!(Ipv4Repr::parse(ipv4_packet, &self.caps.checksum));
         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;
             return None;
         }
         }