forked from Minki/linux
can: af_can: export can_sock_destruct()
In j1939 we need our own struct sock::sk_destruct callback. Export the
generic af_can can_sock_destruct() that allows us to chain-call it.
Fixes: 9d71dd0c70
("can: add support of SAE J1939 protocol")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
This commit is contained in:
parent
5aa4277d43
commit
975987e701
@ -65,5 +65,6 @@ extern void can_rx_unregister(struct net *net, struct net_device *dev,
|
||||
void *data);
|
||||
|
||||
extern int can_send(struct sk_buff *skb, int loop);
|
||||
void can_sock_destruct(struct sock *sk);
|
||||
|
||||
#endif /* !_CAN_CORE_H */
|
||||
|
@ -86,11 +86,12 @@ static atomic_t skbcounter = ATOMIC_INIT(0);
|
||||
|
||||
/* af_can socket functions */
|
||||
|
||||
static void can_sock_destruct(struct sock *sk)
|
||||
void can_sock_destruct(struct sock *sk)
|
||||
{
|
||||
skb_queue_purge(&sk->sk_receive_queue);
|
||||
skb_queue_purge(&sk->sk_error_queue);
|
||||
}
|
||||
EXPORT_SYMBOL(can_sock_destruct);
|
||||
|
||||
static const struct can_proto *can_get_proto(int protocol)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user