device.c (f777316e52e14059a6a1df45cbf39a93ac49a593) device.c (261e224d6a5c43e2bb8a07b7662f9b4ec425cfec)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
4 */
5
6#include "queueing.h"
7#include "socket.h"
8#include "timers.h"

--- 55 unchanged lines hidden (view full) ---

64{
65 struct wg_device *wg;
66 struct wg_peer *peer;
67
68 /* If the machine is constantly suspending and resuming, as part of
69 * its normal operation rather than as a somewhat rare event, then we
70 * don't actually want to clear keys.
71 */
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
4 */
5
6#include "queueing.h"
7#include "socket.h"
8#include "timers.h"

--- 55 unchanged lines hidden (view full) ---

64{
65 struct wg_device *wg;
66 struct wg_peer *peer;
67
68 /* If the machine is constantly suspending and resuming, as part of
69 * its normal operation rather than as a somewhat rare event, then we
70 * don't actually want to clear keys.
71 */
72 if (IS_ENABLED(CONFIG_PM_AUTOSLEEP) || IS_ENABLED(CONFIG_ANDROID))
72 if (IS_ENABLED(CONFIG_PM_AUTOSLEEP) ||
73 IS_ENABLED(CONFIG_PM_USERSPACE_AUTOSLEEP))
73 return 0;
74
75 if (action != PM_HIBERNATION_PREPARE && action != PM_SUSPEND_PREPARE)
76 return 0;
77
78 rtnl_lock();
79 list_for_each_entry(wg, &device_list, device_list) {
80 mutex_lock(&wg->device_update_lock);

--- 397 unchanged lines hidden ---
74 return 0;
75
76 if (action != PM_HIBERNATION_PREPARE && action != PM_SUSPEND_PREPARE)
77 return 0;
78
79 rtnl_lock();
80 list_for_each_entry(wg, &device_list, device_list) {
81 mutex_lock(&wg->device_update_lock);

--- 397 unchanged lines hidden ---