mirror-linux/include/net
Kuniyuki Iwashima df30285b36 af_unix: Introduce SO_INQ.
We have an application that uses almost the same code for TCP and
AF_UNIX (SOCK_STREAM).

TCP can use TCP_INQ, but AF_UNIX doesn't have it and requires an
extra syscall, ioctl(SIOCINQ) or getsockopt(SO_MEMINFO) as an
alternative.

Let's introduce the generic version of TCP_INQ.

If SO_INQ is enabled, recvmsg() will put a cmsg of SCM_INQ that
contains the exact value of ioctl(SIOCINQ).  The cmsg is also
included when msg->msg_get_inq is non-zero to make sockets
io_uring-friendly.

Note that SOCK_CUSTOM_SOCKOPT is flagged only for SOCK_STREAM to
override setsockopt() for SOL_SOCKET.

By having the flag in struct unix_sock, instead of struct sock, we
can later add SO_INQ support for TCP and reuse tcp_sk(sk)->recvmsg_inq.

Note also that supporting custom getsockopt() for SOL_SOCKET will need
preparation for other SOCK_CUSTOM_SOCKOPT users (UDP, vsock, MPTCP).

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250702223606.1054680-7-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-08 18:05:25 -07:00
..
9p
bluetooth Bluetooth: hci_core: Fix use-after-free in vhci_flush() 2025-06-23 10:59:29 -04:00
caif
iucv
libeth libeth: xdp, xsk: access adjacent u32s as u64 where applicable 2025-06-16 11:40:15 -07:00
mana net: mana: Handle Reset Request from MANA NIC 2025-07-01 19:17:53 -07:00
netfilter netfilter: nf_tables: Add notifications for hook changes 2025-05-23 13:57:14 +02:00
netns ipv6: Protect fib6_link_table() with spinlock. 2025-04-24 09:29:56 +02:00
nfc
page_pool page_pool: make page_pool_get_dma_addr() just wrap page_pool_get_dma_addr_netmem() 2025-07-07 18:40:10 -07:00
phonet
sctp sctp: mark sctp_do_peeloff static 2025-05-27 18:18:55 -07:00
tc_act net/sched: Remove unused functions 2025-06-25 15:28:08 -07:00
6lowpan.h
Space.h
act_api.h net/sched: acp_api: no longer acquire RTNL in tc_action_net_exit() 2025-07-08 13:00:24 +02:00
addrconf.h ipv6: Add __in6_dev_get_rtnl_net(). 2025-01-20 12:16:04 -08:00
af_ieee802154.h
af_rxrpc.h rxrpc: Remove deadcode 2025-04-24 17:03:45 -07:00
af_unix.h af_unix: Introduce SO_INQ. 2025-07-08 18:05:25 -07:00
af_vsock.h vsock: Move lingering logic to af_vsock core 2025-05-27 11:05:21 +02:00
ah.h
aligned_data.h udp: move udp_memory_allocated into net_aligned_data 2025-07-02 14:22:02 -07:00
amt.h
arp.h
atmclip.h
ax25.h ax25: Remove broken autobind 2025-03-24 10:26:53 +00:00
ax88796.h
bareudp.h
bond_3ad.h
bond_alb.h
bond_options.h net: bonding: add broadcast_neighbor option for 802.3ad 2025-07-08 10:59:41 +02:00
bonding.h net: bonding: add broadcast_neighbor option for 802.3ad 2025-07-08 10:59:41 +02:00
bpf_sk_storage.h
busy_poll.h net: gro: decouple GRO from the NAPI layer 2025-02-27 14:03:14 +01:00
calipso.h
cfg80211-wext.h
cfg80211.h wifi: cfg80211: support configuration of S1G station capabilities 2025-06-24 15:19:28 +02:00
cfg802154.h
checksum.h net: Fix checksum update for ILA adj-transport 2025-05-30 19:53:51 -07:00
cipso_ipv4.h
cls_cgroup.h
codel.h
codel_impl.h
codel_qdisc.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
devlink.h devlink: Extend devlink rate API with traffic classes bandwidth management 2025-07-02 15:39:05 -07:00
dropreason-core.h can: add drop reasons in the receive path of AF_CAN 2025-06-10 10:23:30 +02:00
dropreason.h wifi: mac80211: Drop cooked monitor support 2025-02-11 11:58:17 +01:00
dsa.h net: dsa: tag_brcm: add support for legacy FCS tags 2025-06-17 17:52:01 -07:00
dsa_stubs.h
dscp.h
dsfield.h
dst.h net: dst: add four helpers to annotate data-races around dst->dev 2025-07-02 14:32:30 -07:00
dst_cache.h
dst_metadata.h net: Add options as a flexible array to struct ip_tunnel_info 2025-02-20 13:17:16 -08:00
dst_ops.h
eee.h
erspan.h
esp.h
espintcp.h
ethoc.h
failover.h
fib_notifier.h
fib_rules.h net: fib_rules: Fix iif / oif matching on L3 master device 2025-04-15 17:54:56 -07:00
firewire.h
flow.h ip: load balance tcp connections to single dst addr and port 2025-04-29 16:22:25 +02:00
flow_dissector.h
flow_offload.h
fou.h
fq.h
fq_impl.h
garp.h
gen_stats.h
genetlink.h
geneve.h
gre.h
gro.h net: gro: expose GRO init/cleanup to use outside of NAPI 2025-02-27 14:03:14 +01:00
gro_cells.h
gso.h
gtp.h
gue.h
handshake.h
hotdata.h net: introduce per netns packet chains 2025-03-24 13:58:22 -07:00
hwbm.h
icmp.h
ieee8021q.h
ieee80211_radiotap.h
ieee802154_netdev.h
if_inet6.h
ife.h
inet6_connection_sock.h tcp/dccp: Remove inet_connection_sock_af_ops.addr2sockaddr(). 2025-03-24 12:10:13 -07:00
inet6_hashtables.h ipv6: adopt skb_dst_dev() and skb_dst_dev_net[_rcu]() helpers 2025-07-02 14:32:30 -07:00
inet_common.h
inet_connection_sock.h tcp/dccp: remove icsk->icsk_ack.timeout 2025-03-25 10:34:33 -07:00
inet_dscp.h
inet_ecn.h
inet_frag.h inet: frags: change inet_frag_kill() to defer refcount updates 2025-03-18 13:18:36 +01:00
inet_hashtables.h ipv4: adopt dst_dev, skb_dst_dev and skb_dst_dev_net[_rcu] 2025-07-02 14:32:30 -07:00
inet_sock.h sctp: Prepare sctp_v4_get_dst() to dscp_t conversion. 2025-01-06 13:49:38 -08:00
inet_timewait_sock.h
inetpeer.h
ioam6.h
ip.h ipv4: adopt dst_dev, skb_dst_dev and skb_dst_dev_net[_rcu] 2025-07-02 14:32:30 -07:00
ip6_checksum.h
ip6_fib.h ipv6: Defer fib6_purge_rt() in fib6_add_rt2node() to fib6_add(). 2025-04-24 09:29:56 +02:00
ip6_route.h ipv6: adopt dst_dev() helper 2025-07-02 14:32:30 -07:00
ip6_tunnel.h ipv6: adopt skb_dst_dev() and skb_dst_dev_net[_rcu]() helpers 2025-07-02 14:32:30 -07:00
ip_fib.h ipv4: prefer multipath nexthop that matches source address 2025-04-29 16:22:25 +02:00
ip_tunnels.h net: ipv4: Add a flags argument to iptunnel_xmit(), udp_tunnel_xmit_skb() 2025-06-17 18:18:44 -07:00
ip_vs.h
ipcomp.h xfrm: ipcomp: Use crypto_acomp interface 2025-03-21 17:36:49 +08:00
ipconfig.h
ipv6.h ipv6: fix _DEVADD() and _DEVUPD() macros 2025-03-25 07:31:24 -07:00
ipv6_frag.h inet: frags: change inet_frag_kill() to defer refcount updates 2025-03-18 13:18:36 +01:00
ipv6_stubs.h
iw_handler.h
kcm.h
l3mdev.h net: fib_rules: Fix iif / oif matching on L3 master device 2025-04-15 17:54:56 -07:00
lag.h
lapb.h
llc.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
lwtunnel.h net: dst: annotate data-races around dst->output 2025-07-02 14:32:30 -07:00
mac80211.h wifi: mac80211: handle station association response with S1G 2025-06-24 15:19:28 +02:00
mac802154.h
macsec.h net: macsec: Add endianness annotations in salt struct 2025-01-20 12:20:42 +00:00
mctp.h net: mctp: add gateway routing support 2025-07-08 12:39:24 +02:00
mctpdevice.h
mip6.h
mld.h
mpls.h
mpls_iptunnel.h
mptcp.h mptcp: sched: remove mptcp_sched_data 2025-04-15 08:21:46 -07:00
mrp.h
ncsi.h
ndisc.h
neighbour.h neighbor: Add NTF_EXT_VALIDATED flag for externally validated entries 2025-06-30 18:14:23 -07:00
neighbour_tables.h
net_debug.h
net_failover.h
net_namespace.h net: Remove ->exit_batch_rtnl(). 2025-04-14 17:08:45 -07:00
net_ratelimit.h
net_shaper.h
net_trackers.h
netdev_lock.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-05-22 09:42:41 -07:00
netdev_netlink.h net: add granular lock for the netdev netlink socket 2025-03-12 13:32:35 -07:00
netdev_queues.h queue_api: add subqueue variant netif_subqueue_sent 2025-06-10 15:27:18 -07:00
netdev_rx_queue.h net: designate XSK pool pointers in queues as "ops protected" 2025-04-09 17:01:51 -07:00
netevent.h
netkit.h
netlabel.h
netlink.h netlink: introduce type-checking attribute iteration for nlmsg 2025-07-02 15:39:04 -07:00
netmem.h netmem: use _Generic to cover const casting for page_to_netmem() 2025-07-07 18:40:10 -07:00
netprio_cgroup.h
netrom.h
nexthop.h ipv6: Protect nh->f6i_list with spinlock and flag. 2025-04-24 09:29:56 +02:00
nl802154.h
nsh.h
pfcp.h net: pfcp: fix typo in message_priority field name 2025-06-13 18:17:08 -07:00
pie.h
ping.h
pkt_cls.h net: sched: refine software bypass handling in tc_run 2025-01-20 09:21:27 +00:00
pkt_sched.h
pptp.h
proto_memory.h
protocol.h
psample.h
psnap.h
raw.h
rawv6.h
red.h
regulatory.h
request_sock.h tcp: remove inet_rtx_syn_ack() 2025-06-27 15:34:19 -07:00
rose.h
route.h ipv4: adopt dst_dev, skb_dst_dev and skb_dst_dev_net[_rcu] 2025-07-02 14:32:30 -07:00
rpl.h
rps.h net: rfs: add sock_rps_delete_flow() helper 2025-05-16 16:03:48 -07:00
rsi_91x.h
rstreason.h net: Retire DCCP socket. 2025-04-11 18:58:10 -07:00
rtnetlink.h rtnetlink: Remove "net" from newlink params 2025-02-21 15:28:03 -08:00
rtnh.h
sch_generic.h net_sched: remove qdisc_tree_flush_backlog() 2025-06-12 08:05:50 -07:00
scm.h scm: Move scm_recv() from scm.h to scm.c. 2025-05-23 10:24:18 +01:00
secure_seq.h net: Retire DCCP socket. 2025-04-11 18:58:10 -07:00
seg6.h
seg6_hmac.h
seg6_local.h
selftests.h
slhc_vj.h
smc.h
snmp.h percpu: use TYPEOF_UNQUAL() in variable declarations 2025-03-16 22:05:53 -07:00
sock.h net: make sk->sk_rcvtimeo lockless 2025-06-23 17:05:12 -07:00
sock_reuseport.h
stp.h
strparser.h strparser: Remove unused __strp_unpause 2025-05-05 16:48:12 -07:00
switchdev.h
tc_wrapper.h
tcp.h tcp: move tcp_memory_allocated into net_aligned_data 2025-07-02 14:22:02 -07:00
tcp_ao.h
tcp_states.h
tcx.h
timewait_sock.h
tipc.h
tls.h
tls_prot.h
tls_toe.h
transp_v6.h
tso.h
tun_proto.h
udp.h udp: move udp_memory_allocated into net_aligned_data 2025-07-02 14:22:02 -07:00
udp_tunnel.h udp_tunnel: fix deadlock in udp_tunnel_nic_set_port_priv() 2025-06-24 16:31:36 -07:00
udplite.h
vsock_addr.h
vxlan.h vxlan: Support MC routing in the underlay 2025-06-17 18:18:46 -07:00
wext.h
x25.h
x25device.h
xdp.h xdp: create locked/unlocked instances of xdp redirect target setters 2025-04-22 19:57:56 -07:00
xdp_priv.h
xdp_sock.h xsk: Fix race condition in AF_XDP generic RX path 2025-04-24 17:11:33 -07:00
xdp_sock_drv.h xsk: Add launch time hardware offload support to XDP Tx metadata 2025-02-20 15:13:45 -08:00
xfrm.h ipsec-next-2025-05-23 2025-05-26 18:32:48 +02:00
xsk_buff_pool.h xsk: Fix offset calculation in unaligned mode 2025-04-24 17:11:52 -07:00