From: Jason Ish Date: Sun, 15 Jan 2023 16:05:29 +0000 (-0600) Subject: dns: never return error on UDP DNS X-Git-Tag: suricata-7.0.0-rc1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab3f36b8cd0bf4796d37d4fea91d6a17b59c605;p=thirdparty%2Fsuricata.git dns: never return error on UDP DNS UDP parsers should never return error as it should indicate to Suricata that an unrecoverable error has occurred. UDP being record based for the most part is almost always recoverable, at least for protocols like DNS. --- diff --git a/rust/src/dns/dns.rs b/rust/src/dns/dns.rs index c21abdd34f..347fbdabd9 100644 --- a/rust/src/dns/dns.rs +++ b/rust/src/dns/dns.rs @@ -767,11 +767,8 @@ pub unsafe extern "C" fn rs_dns_parse_request( stream_slice: StreamSlice, _data: *const std::os::raw::c_void, ) -> AppLayerResult { let state = cast_pointer!(state, DNSState); - if state.parse_request_udp(flow, stream_slice) { - AppLayerResult::ok() - } else { - AppLayerResult::err() - } + state.parse_request_udp(flow, stream_slice); + AppLayerResult::ok() } #[no_mangle] @@ -780,11 +777,8 @@ pub unsafe extern "C" fn rs_dns_parse_response( stream_slice: StreamSlice, _data: *const std::os::raw::c_void, ) -> AppLayerResult { let state = cast_pointer!(state, DNSState); - if state.parse_response_udp(flow, stream_slice) { - AppLayerResult::ok() - } else { - AppLayerResult::err() - } + state.parse_response_udp(flow, stream_slice); + AppLayerResult::ok() } /// C binding parse a DNS request. Returns 1 on success, -1 on failure.