瀏覽代碼

Ipv6RoutingHeader::clear_reserved: fix offsets for Type 2 routing headers

Luqman Aden 1 年之前
父節點
當前提交
2819368e8c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/wire/ipv6routing.rs

+ 2 - 2
src/wire/ipv6routing.rs

@@ -261,10 +261,10 @@ impl<T: AsRef<[u8]> + AsMut<[u8]>> Header<T> {
 
         match routing_type {
             Type::Type2 => {
+                data[2] = 0;
+                data[3] = 0;
                 data[4] = 0;
                 data[5] = 0;
-                data[6] = 0;
-                data[7] = 0;
             }
             Type::Rpl => {
                 // Retain the higher order 4 bits of the padding field