Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102094738
D35990.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D35990.diff
View Options
Index: sys/dev/wg/if_wg.c
===================================================================
--- sys/dev/wg/if_wg.c
+++ sys/dev/wg/if_wg.c
@@ -945,7 +945,7 @@
static void
wg_timers_enable(struct wg_peer *peer)
{
- ck_pr_store_bool(&peer->p_enabled, true);
+ peer->p_enabled = true;
wg_timers_run_persistent_keepalive(peer);
}
@@ -964,9 +964,9 @@
*
* We should also pull NET_EPOCH_WAIT out of the FOREACH(peer) loops, but the
* performance impact is acceptable for the time being. */
- ck_pr_store_bool(&peer->p_enabled, false);
+ peer->p_enabled = false;
NET_EPOCH_WAIT();
- ck_pr_store_bool(&peer->p_need_another_keepalive, false);
+ peer->p_need_another_keepalive = false;
callout_stop(&peer->p_new_handshake);
callout_stop(&peer->p_send_keepalive);
@@ -980,9 +980,9 @@
{
struct epoch_tracker et;
if (interval != peer->p_persistent_keepalive_interval) {
- ck_pr_store_16(&peer->p_persistent_keepalive_interval, interval);
+ peer->p_persistent_keepalive_interval = interval;
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled))
+ if (peer->p_enabled)
wg_timers_run_persistent_keepalive(peer);
NET_EPOCH_EXIT(et);
}
@@ -1002,7 +1002,7 @@
{
struct epoch_tracker et;
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled) && !callout_pending(&peer->p_new_handshake))
+ if (peer->p_enabled && !callout_pending(&peer->p_new_handshake))
callout_reset(&peer->p_new_handshake, MSEC_2_TICKS(
NEW_HANDSHAKE_TIMEOUT * 1000 +
arc4random_uniform(REKEY_TIMEOUT_JITTER)),
@@ -1015,13 +1015,13 @@
{
struct epoch_tracker et;
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled)) {
+ if (peer->p_enabled) {
if (!callout_pending(&peer->p_send_keepalive))
callout_reset(&peer->p_send_keepalive,
MSEC_2_TICKS(KEEPALIVE_TIMEOUT * 1000),
wg_timers_run_send_keepalive, peer);
else
- ck_pr_store_bool(&peer->p_need_another_keepalive, true);
+ peer->p_need_another_keepalive = true;
}
NET_EPOCH_EXIT(et);
}
@@ -1044,8 +1044,8 @@
struct epoch_tracker et;
uint16_t interval;
NET_EPOCH_ENTER(et);
- interval = ck_pr_load_16(&peer->p_persistent_keepalive_interval);
- if (ck_pr_load_bool(&peer->p_enabled) && interval > 0)
+ interval = peer->p_persistent_keepalive_interval;
+ if (peer->p_enabled && interval > 0)
callout_reset(&peer->p_persistent_keepalive,
MSEC_2_TICKS(interval * 1000),
wg_timers_run_persistent_keepalive, peer);
@@ -1057,7 +1057,7 @@
{
struct epoch_tracker et;
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled))
+ if (peer->p_enabled)
callout_reset(&peer->p_retry_handshake, MSEC_2_TICKS(
REKEY_TIMEOUT * 1000 +
arc4random_uniform(REKEY_TIMEOUT_JITTER)),
@@ -1070,7 +1070,7 @@
{
struct epoch_tracker et;
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled)) {
+ if (peer->p_enabled) {
mtx_lock(&peer->p_handshake_mtx);
callout_stop(&peer->p_retry_handshake);
peer->p_handshake_retries = 0;
@@ -1086,7 +1086,7 @@
{
struct epoch_tracker et;
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled))
+ if (peer->p_enabled)
callout_reset(&peer->p_zero_key_material,
MSEC_2_TICKS(REJECT_AFTER_TIME * 3 * 1000),
wg_timers_run_zero_key_material, peer);
@@ -1098,7 +1098,7 @@
{
struct epoch_tracker et;
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled))
+ if (peer->p_enabled)
wg_timers_run_send_initiation(peer, false);
NET_EPOCH_EXIT(et);
}
@@ -1138,7 +1138,7 @@
callout_stop(&peer->p_send_keepalive);
wg_queue_purge(&peer->p_stage_queue);
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled) &&
+ if (peer->p_enabled &&
!callout_pending(&peer->p_zero_key_material))
callout_reset(&peer->p_zero_key_material,
MSEC_2_TICKS(REJECT_AFTER_TIME * 3 * 1000),
@@ -1155,9 +1155,8 @@
wg_send_keepalive(peer);
NET_EPOCH_ENTER(et);
- if (ck_pr_load_bool(&peer->p_enabled) &&
- ck_pr_load_bool(&peer->p_need_another_keepalive)) {
- ck_pr_store_bool(&peer->p_need_another_keepalive, false);
+ if (peer->p_enabled && peer->p_need_another_keepalive) {
+ peer->p_need_another_keepalive = false;
callout_reset(&peer->p_send_keepalive,
MSEC_2_TICKS(KEEPALIVE_TIMEOUT * 1000),
wg_timers_run_send_keepalive, peer);
@@ -1194,7 +1193,7 @@
{
struct wg_peer *peer = _peer;
- if (ck_pr_load_16(&peer->p_persistent_keepalive_interval) > 0)
+ if (peer->p_persistent_keepalive_interval > 0)
wg_send_keepalive(peer);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 1:32 PM (21 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14535798
Default Alt Text
D35990.diff (4 KB)
Attached To
Mode
D35990: wg: Use plain loads/stores for keepalive management.
Attached
Detach File
Event Timeline
Log In to Comment