diff options
author | bz <bz@FreeBSD.org> | 2009-07-21 21:58:55 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2009-07-21 21:58:55 +0000 |
commit | 1f4b104d4db1667a601af3c0725a15f5e503203e (patch) | |
tree | 9c7c5b17e1d92a3118a038d42dac35b24c53b549 /sys/netinet6 | |
parent | 68cbb6a7463b70cec8d8a0cd9948339a98406099 (diff) | |
download | FreeBSD-src-1f4b104d4db1667a601af3c0725a15f5e503203e.zip FreeBSD-src-1f4b104d4db1667a601af3c0725a15f5e503203e.tar.gz |
sysctl_msec_to_ticks is used with both virtualized and
non-vrtiualized sysctls so we cannot used one common function.
Add a macro to convert the arg1 in the virtualized case to
vnet.h to not expose the maths to all over the code.
Add a wrapper for the single virtualized call, properly handling
arg1 and call the default implementation from there.
Convert the two over places to use the new macro.
Reviewed by: rwatson
Approved by: re (kib)
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6_proto.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 1a536dc..57253f7 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -452,11 +452,7 @@ sysctl_ip6_temppltime(SYSCTL_HANDLER_ARGS) int error = 0; int old; -#ifdef VIMAGE - if (arg1 != NULL) - arg1 = (void *)(TD_TO_VNET(req->td)->vnet_data_base + - (uintptr_t)arg1); -#endif + VNET_SYSCTL_ARG(req, arg1); error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) @@ -477,11 +473,7 @@ sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS) int error = 0; int old; -#ifdef VIMAGE - if (arg1 != NULL) - arg1 = (void *)(TD_TO_VNET(req->td)->vnet_data_base + - (uintptr_t)arg1); -#endif + VNET_SYSCTL_ARG(req, arg1); error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) |