[Swan-dev] [PATCH] klips: fix pointer interpretation in ipsec_device_event() due to api change

Richard Guy Briggs rgb at tricolour.ca
Sat Sep 3 23:22:45 UTC 2016


The pointer passed in to the netdev notifier callback function changed from
being a device pointer to being a netdev_notifier_info pointer.

upstream: 3.11-rc1
rhel7: kernel-3.10.0-414.el7
fedora: kernel-3.11.0-0.rc0.git6.1.fc20

See:
	commit 351638e7deeed2ec8ce451b53d33921b3da68f83
	Author: Jiri Pirko <jiri at resnulli.us>
	Date:   Tue May 28 01:30:21 2013 +0000

	net: pass info struct via netdevice notifier

	So far, only net_device * could be passed along with netdevice notifier
	event. This patch provides a possibility to pass custom structure
	able to provide info that event listener needs to know.

Signed-off-by: Richard Guy Briggs <rgb at tricolour.ca>
---
 linux/net/ipsec/ipsec_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux/net/ipsec/ipsec_tunnel.c b/linux/net/ipsec/ipsec_tunnel.c
index 021fc69..8488867 100644
--- a/linux/net/ipsec/ipsec_tunnel.c
+++ b/linux/net/ipsec/ipsec_tunnel.c
@@ -1874,7 +1874,7 @@ struct net_device *ipsec_get_device(int inst)
 int ipsec_device_event(struct notifier_block *unused, unsigned long event,
 		       void *ptr)
 {
-	struct net_device *dev = ptr;
+	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
 	struct net_device *ipsec_dev;
 	struct ipsecpriv *priv;
 	int i;
-- 
2.5.5



More information about the Swan-dev mailing list