summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/conn.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index 125277be21..159b232b5f 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -90,12 +90,12 @@ connection_struct *conn_find(unsigned cnum)
connection_struct *conn_find_byname(const char *service)
{
- int count=0;
connection_struct *conn;
- for (conn=Connections;conn;conn=conn->next,count++) {
+ for (conn=Connections;conn;conn=conn->next) {
if (strequal(lp_servicename(SNUM(conn)),service)) {
- if (count > 10) {
+ if (conn != Connections) {
+ /* Promote if not first. */
DLIST_PROMOTE(Connections, conn);
}
return conn;