summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-08-26 10:04:10 +0000
committerLuiz Souza <luiz@netgate.com>2017-05-09 16:00:51 -0500
commit8e7913babb07928b594c165c9027dbb7cf2e3d82 (patch)
tree034a5a8a3cca543f64ef587a5bb346498e81dd9a /sys/rpc
parent4b2de7d4b5719b172b76cc5a41edaecfda02d030 (diff)
downloadFreeBSD-src-8e7913babb07928b594c165c9027dbb7cf2e3d82.zip
FreeBSD-src-8e7913babb07928b594c165c9027dbb7cf2e3d82.tar.gz
MFC r303382:
Provide the getboottime(9) and getboottimebin(9) KPI. MFC r303387: Prevent parallel tc_windup() calls. Keep boottime in timehands, and adjust it from tc_windup(). MFC notes: The boottime and boottimebin globals are still exported from the kernel dyn symbol table in stable/11, but their declarations are removed from sys/time.h. This preserves KBI but not KPI, while all in-tree consumers are converted to getboottime(). The variables are updated after tc_setclock_mtx is dropped, which gives approximately same unlocked bugs as before. The boottime and boottimebin locals in several sys/kern_tc.c functions were renamed by adding the '_x' suffix to avoid name conficts. (cherry picked from commit 5eaf5813abcaf71c35e1006aab0a861cd104f3aa)
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/rpcsec_gss/svc_rpcsec_gss.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
index 1d07943..0879299 100644
--- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
@@ -504,11 +504,13 @@ svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *id)
{
struct svc_rpc_gss_client *client;
struct svc_rpc_gss_client_list *list;
+ struct timeval boottime;
unsigned long hostid;
rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id);
getcredhostid(curthread->td_ucred, &hostid);
+ getboottime(&boottime);
if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec)
return (NULL);
@@ -537,6 +539,7 @@ svc_rpc_gss_create_client(void)
{
struct svc_rpc_gss_client *client;
struct svc_rpc_gss_client_list *list;
+ struct timeval boottime;
unsigned long hostid;
rpc_gss_log_debug("in svc_rpc_gss_create_client()");
@@ -547,6 +550,7 @@ svc_rpc_gss_create_client(void)
sx_init(&client->cl_lock, "GSS-client");
getcredhostid(curthread->td_ucred, &hostid);
client->cl_id.ci_hostid = hostid;
+ getboottime(&boottime);
client->cl_id.ci_boottime = boottime.tv_sec;
client->cl_id.ci_id = svc_rpc_gss_next_clientid++;
list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE];
OpenPOWER on IntegriCloud