[PATCH net-next v2 0/7] net: convert atm/xdp/af_iucv/l2tp_ppp/rxrpc/tipc to getsockopt_iter
Breno Leitao
leitao at debian.org
Fri May 15 01:32:24 PDT 2026
This series continues the conversion of the remaining proto_ops getsockopt
callbacks to the new getsockopt_iter callback introduced in commit 67fab22a7adc
("net: add getsockopt_iter callback to proto_ops").
The new callback takes a sockopt_t — a type-safe wrapper around iov_iter
plus an optlen field — instead of raw __user pointers. This:
- Replaces (char __user *optval, int __user *optlen) with sockopt_t *opt
- Reads the input buffer size from opt->optlen instead of get_user()
- Writes the option value via copy_to_iter() instead of copy_to_user()
- Reports the returned length via opt->optlen instead of put_user(),
independently of the bytes copied through the iter
Each conversion is a behaviour-preserving and code-style-preserving refactor;
no big changes being introduced, even when the code looks weird.
Signed-off-by: Breno Leitao <leitao at debian.org>
---
Changes in v2:
- Fix a issue reported by sashiko, where I was using "long int" instead
of "int" for a value.
- Nit from Stanislav
- Added an additional patch to make the af_iucv SO_MSGSIZE similar to
its partners.
- Link to v1: https://patch.msgid.link/20260513-getsock_four-v1-0-fe7f0e756fac@debian.org
---
Breno Leitao (7):
af_iucv: take socket lock around SO_MSGSIZE getsockopt
af_iucv: convert to getsockopt_iter
atm: convert to getsockopt_iter
xdp: convert to getsockopt_iter
l2tp: ppp: convert to getsockopt_iter
rxrpc: convert to getsockopt_iter
tipc: convert to getsockopt_iter
net/atm/common.c | 18 +++++++++++-------
net/atm/common.h | 2 +-
net/atm/pvc.c | 6 +++---
net/atm/svc.c | 15 +++++++--------
net/iucv/af_iucv.c | 16 ++++++++--------
net/l2tp/l2tp_ppp.c | 20 +++++++-------------
net/rxrpc/af_rxrpc.c | 16 +++++++++-------
net/tipc/socket.c | 31 ++++++++++++++++---------------
net/xdp/xsk.c | 24 +++++++++++-------------
9 files changed, 73 insertions(+), 75 deletions(-)
---
base-commit: afb06186b0a5f3ff659cfd97421660c95bbde3be
change-id: 20260513-getsock_four-063e6a724555
Best regards,
--
Breno Leitao <leitao at debian.org>
More information about the linux-afs
mailing list