View | Details | Raw Unified | Return to bug 235582 | Differences between
and this patch

Collapse All | Expand All

(-)rpc/rpcsec_gss/svc_rpcsec_gss.c (-8 / +7 lines)
Lines 562-580 svc_rpc_gss_create_client(void) Link Here
562
562
563
	client = mem_alloc(sizeof(struct svc_rpc_gss_client));
563
	client = mem_alloc(sizeof(struct svc_rpc_gss_client));
564
	memset(client, 0, sizeof(struct svc_rpc_gss_client));
564
	memset(client, 0, sizeof(struct svc_rpc_gss_client));
565
	refcount_init(&client->cl_refs, 1);
565
	refcount_init(&client->cl_refs, 2);
566
	sx_init(&client->cl_lock, "GSS-client");
566
	sx_init(&client->cl_lock, "GSS-client");
567
	getcredhostid(curthread->td_ucred, &hostid);
567
	getcredhostid(curthread->td_ucred, &hostid);
568
	client->cl_id.ci_hostid = hostid;
568
	client->cl_id.ci_hostid = hostid;
569
	getboottime(&boottime);
569
	getboottime(&boottime);
570
	client->cl_id.ci_boottime = boottime.tv_sec;
570
	client->cl_id.ci_boottime = boottime.tv_sec;
571
	client->cl_id.ci_id = svc_rpc_gss_next_clientid++;
571
	client->cl_id.ci_id = svc_rpc_gss_next_clientid++;
572
	list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE];
573
	sx_xlock(&svc_rpc_gss_lock);
574
	TAILQ_INSERT_HEAD(list, client, cl_link);
575
	TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink);
576
	svc_rpc_gss_client_count++;
577
	sx_xunlock(&svc_rpc_gss_lock);
578
572
579
	/*
573
	/*
580
	 * Start the client off with a short expiration time. We will
574
	 * Start the client off with a short expiration time. We will
Lines 584-589 svc_rpc_gss_create_client(void) Link Here
584
	client->cl_locked = FALSE;
578
	client->cl_locked = FALSE;
585
	client->cl_expiration = time_uptime + 5*60;
579
	client->cl_expiration = time_uptime + 5*60;
586
580
581
	list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE];
582
	sx_xlock(&svc_rpc_gss_lock);
583
	TAILQ_INSERT_HEAD(list, client, cl_link);
584
	TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink);
585
	svc_rpc_gss_client_count++;
586
	sx_xunlock(&svc_rpc_gss_lock);
587
	return (client);
587
	return (client);
588
}
588
}
589
589
Lines 1301-1307 svc_rpc_gss(struct svc_req *rqst, struct Link Here
1301
			goto out;
1301
			goto out;
1302
		}
1302
		}
1303
		client = svc_rpc_gss_create_client();
1303
		client = svc_rpc_gss_create_client();
1304
		refcount_acquire(&client->cl_refs);
1305
	} else {
1304
	} else {
1306
		struct svc_rpc_gss_clientid *p;
1305
		struct svc_rpc_gss_clientid *p;
1307
		if (gc.gc_handle.length != sizeof(*p)) {
1306
		if (gc.gc_handle.length != sizeof(*p)) {

Return to bug 235582