diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-28 20:39:40 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-28 20:39:40 +0100 |
commit | 36f81c83674e0fd7c18e5b15499d1a275b6d4d7f (patch) | |
tree | 4dca5337d809532722020471d9105cb858e2ccbd /src | |
parent | e1a0f851e2848d428ec5c30eaaea67e2691fe4bb (diff) |
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.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/device.c | 8 |
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(); |