]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
librpc: Simplify find_interface_by_syntax_id()
authorVolker Lendecke <vl@samba.org>
Wed, 27 Jan 2021 12:54:25 +0000 (13:54 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 28 Jan 2021 16:58:35 +0000 (16:58 +0000)
Directly use ndr_syntax_id_equal() instead of duplicating it with
interface_match_by_uuid().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
librpc/rpc/dcesrv_core.c

index 52008227242bbb904b03a95818f839faa596ea8a..5db37ca6716bbfb5e3728891f4b716b048ce7be3 100644 (file)
@@ -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;
                }
        }