]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/nfs: minor code cleanups
authorVictor Julien <victor@inliniac.net>
Fri, 7 Feb 2020 10:33:30 +0000 (11:33 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 2 Mar 2020 16:16:42 +0000 (17:16 +0100)
rust/src/nfs/nfs2.rs
rust/src/nfs/nfs2_records.rs
rust/src/nfs/nfs3.rs
rust/src/nfs/nfs4.rs

index 7b25bb42398d9f73b62373d21f341dbb36f3983a..86f5de81e8490c35cf0c3618277e357bde0714a6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2017-2018 Open Information Security Foundation
+/* Copyright (C) 2017-2020 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -125,5 +125,4 @@ impl NFSState {
 
         0
     }
-
 }
index facaadda02f1682f803f8a255d4509f9bd7e46cc..ed5500db1c2248f0e5fa566f8ca48283d18be4b8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2017 Open Information Security Foundation
+/* Copyright (C) 2017-2020 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
index 0398e10cf6251ac4e6855db93cb605e15cbfc92d..3ca1c0b23ce4b1ce5f7f7824a24690696ae0d605 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2017-2018 Open Information Security Foundation
+/* Copyright (C) 2017-2020 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -297,24 +297,18 @@ impl NFSState {
                     // store all handle/filename mappings
                     match many0_nfs3_response_readdirplus_entries(d) {
                         Ok((_, ref entries)) => {
+                            SCLogDebug!("READDIRPLUS ENTRIES reply {:?}", entries);
                             for ce in entries {
                                 SCLogDebug!("ce {:?}", ce);
-                                match ce.entry {
-                                    Some(ref e) => {
-                                        SCLogDebug!("e {:?}", e);
-                                        match e.handle {
-                                            Some(ref h) => {
-                                                SCLogDebug!("h {:?}", h);
-                                                self.namemap.insert(h.value.to_vec(), e.name_vec.to_vec());
-                                            },
-                                            _ => { },
-                                        }
-                                    },
-                                    _ => { },
+                                if let Some(ref e) = ce.entry {
+                                    SCLogDebug!("e {:?}", e);
+                                    if let Some(ref h) = e.handle {
+                                        SCLogDebug!("h {:?}", h);
+                                        self.namemap.insert(h.value.to_vec(),
+                                                e.name_vec.to_vec());
+                                    }
                                 }
                             }
-
-                            SCLogDebug!("READDIRPLUS ENTRIES reply {:?}", entries);
                         },
                         _ => {
                             self.set_event(NFSEvent::MalformedData);
@@ -345,6 +339,4 @@ impl NFSState {
 
         0
     }
-
 }
-
index f1e527c078494a4467cb292b1abd8b0613c28cd6..16f06e9ac84004329b1b5cf5c58fa8d94d9563f1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018 Open Information Security Foundation
+/* Copyright (C) 2018-2020 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free