From 5342867e3775de0832658581804f7680048421b1 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 28 Nov 2017 20:39:40 +0100 Subject: 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. --- src/device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3-59-g8ed1b