diff options
author | Anjali Kulkarni <anjali.k.kulkarni@oracle.com> | 2023-07-19 23:18:17 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-23 13:34:22 +0300 |
commit | a4c9a56e6a2cdeeab7caef1f496b7bfefd95b50e (patch) | |
tree | 6570a5cb17ff33f9b1f97649b8e86bb98cdd019b /net/netlink/af_netlink.h | |
parent | a3377386b56420d78a4c0a931a40f9a25c3ca2bd (diff) | |
download | linux-a4c9a56e6a2cdeeab7caef1f496b7bfefd95b50e.tar.xz |
netlink: Add new netlink_release function
A new function netlink_release is added in netlink_sock to store the
protocol's release function. This is called when the socket is deleted.
This can be supplied by the protocol via the release function in
netlink_kernel_cfg. This is being added for the NETLINK_CONNECTOR
protocol, so it can free it's data when socket is deleted.
Signed-off-by: Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/af_netlink.h')
-rw-r--r-- | net/netlink/af_netlink.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h index 90a3198a9b7f..fd424cd63f31 100644 --- a/net/netlink/af_netlink.h +++ b/net/netlink/af_netlink.h @@ -42,6 +42,8 @@ struct netlink_sock { void (*netlink_rcv)(struct sk_buff *skb); int (*netlink_bind)(struct net *net, int group); void (*netlink_unbind)(struct net *net, int group); + void (*netlink_release)(struct sock *sk, + unsigned long *groups); struct module *module; struct rhash_head node; @@ -64,6 +66,8 @@ struct netlink_table { struct module *module; int (*bind)(struct net *net, int group); void (*unbind)(struct net *net, int group); + void (*release)(struct sock *sk, + unsigned long *groups); int registered; }; |