can_send(9)
π can_send(9) β the Kernel API Manual page you've been waiting for π
okay bestie, welcome to the Kernel API Manual section 9, where we talk about can_send β the little function that yeets a CAN frame out into the world (and, if you want, loops it back so your local besties can hear it too). β¨
β¨ NAME β¨
can_send β transmit a CAN frame (optional with local loopback) π¦
πΈ SYNOPSIS πΈ
int can_send (struct sk_buff *skb , int loop );
π ARGUMENTS π
skbβ pointer to a socket buffer that's holding your CAN frame down in its data section. that's the cargo, bestie π¦loopβ the loopback for listeners on local CAN sockets. and likeβ¦ it's the recommended default! (yes, with the exclamation point, the manpage is that serious about it π )
π DESCRIPTION π
so here's the tea β β because of the loopback, this routine must not be called from hardirq context. like, don't do it. not the vibe. π
π₯ RETURN π₯
the receipts, in order:
0on success β slay, it worked π-ENETDOWNwhen the selected interface is down π-ENOBUFSon a full driver queue (checknet_xmit_errno, iykyk)-ENOMEMwhen local loopback failed at callingskb_cloneπ-EPERMwhen you're trying to send on a non-CAN interface (wrong crowd, babe)-EMSGSIZEwhen the CAN frame size is bigger than the CAN interface MTU π«-EINVALwhenskb->datadoes not contain a valid CAN frame β literally what are you even handing me
ngl, half of these are just the kernel gently telling you "no <3" β check your interface, your buffer, and your frame before you come for can_send.
π SEE ALSO π
Kernel file ./net/can/af_can.c β plus the whole friend group: effhash(9), can_rcv_list_find(9), can_rx_register(9), can_rx_unregister(9), can_proto_register(9), can_proto_unregister(9). go say hi to all of them, they're iconic π«Ά
and that's the whole page, bestie π β brought to you by ./net/can, dated October 2026. mwah, go transmit responsibly π§β
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms