]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
SNMP: use explicit references to support build with old rust compiler
authorPierre Chifflier <chifflier@wzdftpd.net>
Tue, 4 Dec 2018 16:40:28 +0000 (17:40 +0100)
committerPierre Chifflier <chifflier@wzdftpd.net>
Thu, 6 Jun 2019 08:15:59 +0000 (10:15 +0200)
rust/src/snmp/log.rs
rust/src/snmp/snmp.rs

index 965816148eaae971461a8773ea88b0dbb041d5ae..d7efb8a37a53511d9f748f4937eaae9714bf3965 100644 (file)
@@ -35,8 +35,8 @@ pub extern "C" fn rs_snmp_log_json_response(state: &mut SNMPState, tx: &mut SNMP
                 if info.err.0 != 0 {
                     js.set_string("error", &format!("{:?}", info.err));
                 }
-                match &info.trap_type {
-                    Some((trap_type, oid, address)) => {
+                match info.trap_type {
+                    Some((trap_type, ref oid, address)) => {
                         js.set_string("trap_type", &format!("{:?}", trap_type));
                         js.set_string("trap_oid", &oid.to_string());
                         match address {
index bab066ab19e98d2382a5aa36d8d69e2a8a0893f2..b190351742ba56e35518659b1c18404f26d96d77 100644 (file)
@@ -113,7 +113,7 @@ impl SNMPState {
     fn add_pdu_info(&mut self, pdu: &SnmpPdu, tx: &mut SNMPTransaction) {
         let mut pdu_info = SNMPPduInfo::default();
         pdu_info.pdu_type = pdu.pdu_type();
-        match pdu {
+        match *pdu {
             SnmpPdu::Generic(ref pdu) => {
                 pdu_info.err = pdu.err;
             },