have in_pcbselsrc copy the selected address to memory provided by the caller.
authordlg <dlg@openbsd.org>
Sun, 15 May 2022 09:12:20 +0000 (09:12 +0000)
committerdlg <dlg@openbsd.org>
Sun, 15 May 2022 09:12:20 +0000 (09:12 +0000)
commit089ca45eda6afb3c330881fd7d5a2ef237868262
treeba3fa3a7313ac2a8bdffea05aadab1154f3805cb
parent2f1a7887b0837d24e28a23c76a4c4f20a93a5751
have in_pcbselsrc copy the selected address to memory provided by the caller.

having it return a pointer to something that has a lifetime managed
by a lock without accounting for it or taking a reference count or
anything like that is asking for trouble. copying the address to
caller provded memory while still inside the lock is a lot safer.

discussed with visa@
ok bluhm@ claudio@
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet/raw_ip.c
sys/netinet/udp_usrreq.c