freebsd-src/sys/netgraph
Gleb Smirnoff cfb1e92912 sockets: don't malloc/free sockaddr memory on accept(2)
Let the accept functions provide stack memory for protocols to fill it in.
Generic code should provide sockaddr_storage, specialized code may provide
smaller structure.

While rewriting accept(2) make 'addrlen' a true in/out parameter, reporting
required length in case if provided length was insufficient.  Our manual
page accept(2) and POSIX don't explicitly require that, but one can read
the text as they do.  Linux also does that. Update tests accordingly.

Reviewed by:		rscheff, tuexen, zlei, dchagin
Differential Revision:	https://reviews.freebsd.org/D42635
2023-11-30 08:30:55 -08:00
..
bluetooth sockets: don't malloc/free sockaddr memory on accept(2) 2023-11-30 08:30:55 -08:00
netflow sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
netgraph.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_async.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_async.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_base.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_bpf.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_bpf.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_bridge.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_bridge.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_car.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_car.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_checksum.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ng_checksum.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_cisco.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_cisco.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_deflate.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_deflate.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_device.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_device.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_echo.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_echo.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_eiface.c ng_eiface: switch VNETs when injecting mbufs into netgraph 2023-09-23 10:56:56 +02:00
ng_eiface.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_etf.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_etf.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ether.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ether.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ether_echo.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ether_echo.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_frame_relay.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_frame_relay.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_gif.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_gif.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_gif_demux.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_gif_demux.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_hole.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_hole.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_hub.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_hub.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_iface.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_iface.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ip_input.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ip_input.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ipfw.c ng_ipfw: allow use of 32 bits wide cookies 2023-11-14 16:36:08 +07:00
ng_ipfw.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ksocket.c sockets: don't malloc/free sockaddr memory on accept(2) 2023-11-30 08:30:55 -08:00
ng_ksocket.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_l2tp.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_l2tp.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_lmi.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_lmi.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_macfilter.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_macfilter.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_message.h netgraph: increase size of sockaddr_ng to match maximum node name 2023-11-27 20:10:52 -08:00
ng_mppc.c sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
ng_mppc.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
ng_nat.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_nat.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_one2many.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_one2many.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_parse.c sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
ng_parse.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
ng_patch.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
ng_patch.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_pipe.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_pipe.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ppp.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_ppp.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_pppoe.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_pppoe.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_pptpgre.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_pptpgre.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_pred1.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_pred1.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_rfc1490.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_rfc1490.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_sample.c netgraph: Fix obsolete comment 2023-10-27 14:00:37 -06:00
ng_sample.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_socket.c ng_socket: with getsockname() return node ID for unnamed node 2023-11-27 20:11:38 -08:00
ng_socket.h netgraph: increase size of sockaddr_ng to match maximum node name 2023-11-27 20:10:52 -08:00
ng_socketvar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_source.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ng_source.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_split.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_split.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_tag.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_tag.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_tcpmss.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_tcpmss.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_tee.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_tee.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_tty.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_tty.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_UI.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_UI.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_vjc.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_vjc.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_vlan.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_vlan.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_vlan_rotate.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ng_vlan_rotate.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
NOTES sys: Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:17 -06:00
qos.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00