diff options
author | Volker Lendecke <vl@samba.org> | 2021-01-27 14:00:06 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2021-01-28 18:03:53 +0000 |
commit | e14fc159a2fab69612c6922406a9614a7c2d55ee (patch) | |
tree | b6afbe95ed6d4f59319a94b23ea53ca1e29a9eee /librpc | |
parent | ecd95fc55eb793cfbbe233bd91664b6d646d430f (diff) | |
download | samba-e14fc159a2fab69612c6922406a9614a7c2d55ee.tar.gz |
librpc: Simplify find_interface_by_binding()
Use find_interface_by_syntax_id() instead of duplicating the loop.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jan 28 18:03:53 UTC 2021 on sn-devel-184
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/rpc/dcesrv_core.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/librpc/rpc/dcesrv_core.c b/librpc/rpc/dcesrv_core.c index 5db37ca6716..a51467c87c0 100644 --- a/librpc/rpc/dcesrv_core.c +++ b/librpc/rpc/dcesrv_core.c @@ -106,16 +106,6 @@ static struct dcesrv_connection_context *dcesrv_find_context(struct dcesrv_conne } /* - see if a uuid and if_version match to an interface -*/ -static bool interface_match(const struct dcesrv_interface *if1, - const struct dcesrv_interface *if2) -{ - return (if1->syntax_id.if_version == if2->syntax_id.if_version && - GUID_equal(&if1->syntax_id.uuid, &if2->syntax_id.uuid)); -} - -/* find the interface operations on any endpoint with this binding */ static const struct dcesrv_interface *find_interface_by_binding(struct dcesrv_context *dce_ctx, @@ -125,11 +115,12 @@ static const struct dcesrv_interface *find_interface_by_binding(struct dcesrv_co struct dcesrv_endpoint *ep; for (ep=dce_ctx->endpoint_list; ep; ep=ep->next) { if (endpoints_match(ep->ep_description, binding)) { - struct dcesrv_if_list *ifl; - for (ifl=ep->interface_list; ifl; ifl=ifl->next) { - if (interface_match(ifl->iface, iface)) { - return ifl->iface; - } + const struct dcesrv_interface *ret = NULL; + + ret = find_interface_by_syntax_id( + ep, &iface->syntax_id); + if (ret != NULL) { + return ret; } } } |