This makes the code more efficient.
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi(a)linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
---
src/rpc/virnetserverprogram.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetserverprogram.c b/src/rpc/virnetserverprogram.c
index 556c91605f90..1e8dfc2f1128 100644
--- a/src/rpc/virnetserverprogram.c
+++ b/src/rpc/virnetserverprogram.c
@@ -400,8 +400,8 @@ virNetServerProgramDispatchCall(virNetServerProgramPtr prog,
/* If client is marked as needing auth, don't allow any RPC ops
* which are except for authentication ones
*/
- if (virNetServerClientNeedAuth(client) &&
- dispatcher->needAuth) {
+ if (dispatcher->needAuth &&
+ virNetServerClientNeedAuth(client)) {
/* Explicitly *NOT* calling remoteDispatchAuthError() because
we want back-compatibility with libvirt clients which don't
support the VIR_ERR_AUTH_FAILED error code */
--
2.13.4