From: Volker Lendecke Date: Wed, 27 Jan 2021 12:54:25 +0000 (+0100) Subject: librpc: Simplify find_interface_by_syntax_id() X-Git-Tag: tevent-0.11.0~1868 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecd95fc55eb793cfbbe233bd91664b6d646d430f;p=thirdparty%2Fsamba.git librpc: Simplify find_interface_by_syntax_id() Directly use ndr_syntax_id_equal() instead of duplicating it with interface_match_by_uuid(). Signed-off-by: Volker Lendecke Reviewed-by: Samuel Cabrero --- diff --git a/librpc/rpc/dcesrv_core.c b/librpc/rpc/dcesrv_core.c index 52008227242..5db37ca6716 100644 --- a/librpc/rpc/dcesrv_core.c +++ b/librpc/rpc/dcesrv_core.c @@ -136,16 +136,6 @@ static const struct dcesrv_interface *find_interface_by_binding(struct dcesrv_co return NULL; } -/* - see if a uuid and if_version match to an interface -*/ -static bool interface_match_by_uuid(const struct dcesrv_interface *iface, - const struct GUID *uuid, uint32_t if_version) -{ - return (iface->syntax_id.if_version == if_version && - GUID_equal(&iface->syntax_id.uuid, uuid)); -} - /* find the interface operations on an endpoint by uuid */ @@ -155,10 +145,7 @@ _PUBLIC_ const struct dcesrv_interface *find_interface_by_syntax_id( { struct dcesrv_if_list *ifl; for (ifl=endpoint->interface_list; ifl; ifl=ifl->next) { - if (interface_match_by_uuid( - ifl->iface, - &interface->uuid, - interface->if_version)) { + if (ndr_syntax_id_equal(&ifl->iface->syntax_id, interface)) { return ifl->iface; } }