diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-05-27 21:30:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-28 16:11:01 -0400 |
commit | 351638e7deeed2ec8ce451b53d33921b3da68f83 (patch) | |
tree | 175dfff289b5e3baecffbc7e97d1884e9a18345c /net/netlabel | |
parent | b1098bbe1b24d5d90cff92fbd716d2ef4bed2cff (diff) |
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: Jiri Pirko <jiri@resnulli.us>
v2->v3: fix typo on simeth
shortened dev_getter
shortened notifier_info struct name
v1->v2: fix notifier_call parameter in call_netdevice_notifier()
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlabel')
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 8a6c6ea466d8..af3531926ee0 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -708,7 +708,7 @@ unlhsh_remove_return: | |||
708 | * netlbl_unlhsh_netdev_handler - Network device notification handler | 708 | * netlbl_unlhsh_netdev_handler - Network device notification handler |
709 | * @this: notifier block | 709 | * @this: notifier block |
710 | * @event: the event | 710 | * @event: the event |
711 | * @ptr: the network device (cast to void) | 711 | * @ptr: the netdevice notifier info (cast to void) |
712 | * | 712 | * |
713 | * Description: | 713 | * Description: |
714 | * Handle network device events, although at present all we care about is a | 714 | * Handle network device events, although at present all we care about is a |
@@ -717,10 +717,9 @@ unlhsh_remove_return: | |||
717 | * | 717 | * |
718 | */ | 718 | */ |
719 | static int netlbl_unlhsh_netdev_handler(struct notifier_block *this, | 719 | static int netlbl_unlhsh_netdev_handler(struct notifier_block *this, |
720 | unsigned long event, | 720 | unsigned long event, void *ptr) |
721 | void *ptr) | ||
722 | { | 721 | { |
723 | struct net_device *dev = ptr; | 722 | struct net_device *dev = netdev_notifier_info_to_dev(ptr); |
724 | struct netlbl_unlhsh_iface *iface = NULL; | 723 | struct netlbl_unlhsh_iface *iface = NULL; |
725 | 724 | ||
726 | if (!net_eq(dev_net(dev), &init_net)) | 725 | if (!net_eq(dev_net(dev), &init_net)) |