aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-28 20:39:40 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-28 20:39:40 +0100
commit5342867e3775de0832658581804f7680048421b1 (patch)
tree02cdc0326069ef6a73f24580f7142a99f1fc3f06
parentcurve25519: explictly depend on AS_AVX (diff)
downloadwireguard-monolithic-historical-5342867e3775de0832658581804f7680048421b1.tar.xz
wireguard-monolithic-historical-5342867e3775de0832658581804f7680048421b1.zip
device: do not clear keys during sleep on Android
This makes sense for the security model of laptops, but not for clicking phones on and off, where we actually want to be able to handle incoming packets.
-rw-r--r--src/device.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/device.c b/src/device.c
index 1b3ab4f..d585c56 100644
--- a/src/device.c
+++ b/src/device.c
@@ -64,7 +64,7 @@ static int open(struct net_device *dev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
+#if defined(CONFIG_PM_SLEEP) && !defined(CONFIG_ANDROID)
static int pm_notification(struct notifier_block *nb, unsigned long action, void *data)
{
struct wireguard_device *wg;
@@ -375,7 +375,7 @@ int __init device_init(void)
{
int ret;
-#ifdef CONFIG_PM_SLEEP
+#if defined(CONFIG_PM_SLEEP) && !defined(CONFIG_ANDROID)
ret = register_pm_notifier(&pm_notifier);
if (ret)
return ret;
@@ -394,7 +394,7 @@ int __init device_init(void)
error_netdevice:
unregister_netdevice_notifier(&netdevice_notifier);
error_pm:
-#ifdef CONFIG_PM_SLEEP
+#if defined(CONFIG_PM_SLEEP) && !defined(CONFIG_ANDROID)
unregister_pm_notifier(&pm_notifier);
#endif
return ret;
@@ -404,7 +404,7 @@ void device_uninit(void)
{
rtnl_link_unregister(&link_ops);
unregister_netdevice_notifier(&netdevice_notifier);
-#ifdef CONFIG_PM_SLEEP
+#if defined(CONFIG_PM_SLEEP) && !defined(CONFIG_ANDROID)
unregister_pm_notifier(&pm_notifier);
#endif
rcu_barrier_bh();