Skip to content

net: convert remaining CAN protocols to getsockopt_iter

Breno Leitao linux-can lkml 2 versions – New

Get series with b4
b4 am [email protected] change-id 20260507-getsock_two_can-5d3604b1982f

Versions newest first

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- Rebase on net-next, no code change
- Collect Acked-by from Oleksij Rempel and Oliver Hartkopp
- Link to v1: https://patch.msgid.link/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2can: j1939: convert to getsockopt_iternet/can/j1939/socket.c+13 -80 replies
2/2can: isotp: convert to getsockopt_iternet/can/isotp.c+5 -70 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchOleksij RempelOliver Hartkopp
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH RESEND v2 0/2] net: convert remaining CAN protocols to getsockopt_iter

Continue the conversion of socket protocols to the new getsockopt_iter API by covering the two remaining CAN implementations:

- isotp (CAN ISO-TP)
- j1939 (SAE J1939)

With these, all CAN protocols that expose a getsockopt callback (raw, isotp, j1939) now use .getsockopt_iter; raw was converted as part of an earlier series.

These are mechanical, ABI-preserving conversions following the same pattern as previously converted protocols (af_packet, can/raw, af_netlink, af_vsock):

- The (char __user *optval, int __user *optlen) pair is replaced with a single sockopt_t *opt that carries the buffer length on input and the returned size on output, and exposes an iov_iter for the copy-out path.
- put_user()/copy_to_user() pairs are replaced with a single copy_to_iter() per option.
- The wrapper in do_sock_getsockopt() handles writing optlen back to userspace.

No functional or ABI change is intended.

For more context about the motivation for this change, please check commit 67fab22a7ad ("net: add getsockopt_iter callback to proto_ops")

---
Changes in v2:
- Rebase on net-next, no code change
- Collect Acked-by from Oleksij Rempel and Oliver Hartkopp
- Link to v1: https://patch.msgid.link/[email protected]

---
Breno Leitao (2):
can: j1939: convert to getsockopt_iter
can: isotp: convert to getsockopt_iter

 net/can/isotp.c        | 12 +++++-------
 net/can/j1939/socket.c | 21 +++++++++++++--------
 2 files changed, 18 insertions(+), 15 deletions(-)

---
base-commit: fa5196392691051963726787944db872420dfa75
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main
change-id: 20260507-getsock_two_can-5d3604b1982f

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>