Skip to content

Commit 975987e

Browse files
oleremmarckleinebudde
authored andcommitted
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: 9d71dd0 ("can: add support of SAE J1939 protocol") Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
1 parent 5aa4277 commit 975987e

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎include/linux/can/core.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ extern void can_rx_unregister(struct net *net, struct net_device *dev,
6565
void *data);
6666

6767
extern int can_send(struct sk_buff *skb, int loop);
68+
void can_sock_destruct(struct sock *sk);
6869

6970
#endif /* !_CAN_CORE_H */

‎net/can/af_can.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ static atomic_t skbcounter = ATOMIC_INIT(0);
8686

8787
/* af_can socket functions */
8888

89-
static void can_sock_destruct(struct sock *sk)
89+
void can_sock_destruct(struct sock *sk)
9090
{
9191
skb_queue_purge(&sk->sk_receive_queue);
9292
skb_queue_purge(&sk->sk_error_queue);
9393
}
94+
EXPORT_SYMBOL(can_sock_destruct);
9495

9596
static const struct can_proto *can_get_proto(int protocol)
9697
{

0 commit comments

Comments
 (0)