From d4406e5be631750c382bbe0a0a833bc76c8bb9af Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 2 Oct 2024 12:52:40 +0200 Subject: [PATCH] dcerpc-netlogon: all netr_LogonControl[2[Ex]] calls have the same reply values They all use WERR instead of NTSTATUS. Signed-off-by: Stefan Metzmacher --- epan/dissectors/packet-dcerpc-netlogon.c | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c index 85c04b5b15..c3fe7c8026 100644 --- a/epan/dissectors/packet-dcerpc-netlogon.c +++ b/epan/dissectors/packet-dcerpc-netlogon.c @@ -5122,12 +5122,16 @@ static int netlogon_dissect_netrlogoncontrol_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep) { + uint32_t status; + offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, di, drep, netlogon_dissect_CONTROL_QUERY_INFORMATION, NDR_POINTER_REF, "CONTROL_QUERY_INFORMATION:", -1); - offset = dissect_ntstatus(tvb, offset, pinfo, tree, di, drep, - hf_netlogon_dos_rc, NULL); + offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_netlogon_werr_rc, &status); + + if (status != 0) + col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown WERR error 0x%08x")); return offset; } @@ -5252,19 +5256,7 @@ static int netlogon_dissect_netrlogoncontrol2_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep) { - uint32_t status; - - offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, di, drep, - netlogon_dissect_CONTROL_QUERY_INFORMATION, NDR_POINTER_REF, - "CONTROL_QUERY_INFORMATION:", -1); - - offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_netlogon_werr_rc, &status); - - if (status != 0) - col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown WERR error 0x%08x")); - - - return offset; + return netlogon_dissect_netrlogoncontrol_reply(tvb, offset, pinfo, tree, di, drep); } @@ -5428,14 +5420,7 @@ static int netlogon_dissect_netrlogoncontrol2ex_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, uint8_t *drep) { - offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, di, drep, - netlogon_dissect_CONTROL_QUERY_INFORMATION, NDR_POINTER_REF, - "CONTROL_QUERY_INFORMATION:", -1); - - offset = dissect_ntstatus(tvb, offset, pinfo, tree, di, drep, - hf_netlogon_dos_rc, NULL); - - return offset; + return netlogon_dissect_netrlogoncontrol_reply(tvb, offset, pinfo, tree, di, drep); } -- 2.11.4.GIT