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.
Unified · Split
| @@ -65,5 +65,6 @@ extern void can_rx_unregister(struct net *net, struct net_device *dev, · 64 unmodified lines | |||
| 65 | void *data); | 65 | void *data); |
| 66 | 66 | ||
| 67 | extern int can_send(struct sk_buff *skb, int loop); | 67 | extern int can_send(struct sk_buff *skb, int loop); |
| 68 | void can_sock_destruct(struct sock *sk); | ||
| 68 | 69 | ||
| 69 | #endif /* !_CAN_CORE_H */ | 70 | #endif /* !_CAN_CORE_H */ |
| @@ -86,11 +86,12 @@ static atomic_t skbcounter = ATOMIC_INIT(0); · 85 unmodified lines | |||
| 86 | 86 | ||
| 87 | /* af_can socket functions */ | 87 | /* af_can socket functions */ |
| 88 | 88 | ||
| 89 | static void can_sock_destruct(struct sock *sk) | 89 | void can_sock_destruct(struct sock *sk) |
| 90 | { | 90 | { |
| 91 | skb_queue_purge(&sk->sk_receive_queue); | 91 | skb_queue_purge(&sk->sk_receive_queue); |
| 92 | skb_queue_purge(&sk->sk_error_queue); | 92 | skb_queue_purge(&sk->sk_error_queue); |
| 93 | } | 93 | } |
| 94 | EXPORT_SYMBOL(can_sock_destruct); | ||
| 94 | 95 | ||
| 95 | static const struct can_proto *can_get_proto(int protocol) | 96 | static const struct can_proto *can_get_proto(int protocol) |
| 96 | { | 97 | { |