summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_socket.c
AgeCommit message (Collapse)Author
2017-03-14Use if_acquire and if_release instead of using psref API directlyozaki-r
- Provide if_release for consistency to if_acquire - Use if_acquire and if_release for ifp iterations - Make ifnet_psref_class static
2017-02-03add sendmmsg and recvmmsgchristos
2017-02-03handle accept4 for i386christos
2017-02-03Do not compile accept4 on i386, there is no such syscall in Linux.martin
2017-02-02implement accept4christos
2016-09-13Make the ktrace record written by do_sys_sendmsg/do_sys_recvmsg overridablemartin
by the caller. Use this in compat_netbsd32 to log the 32bit version, so the 32bit userland kdump is happy.
2016-08-01Apply pserialize and psref to struct ifaddr and its variantsozaki-r
This change makes struct ifaddr and its variants (in_ifaddr and in6_ifaddr) MP-safe by using pserialize and psref. At this moment, pserialize_perform and psref_target_destroy are disabled because (1) we don't need them because of softnet_lock (2) they cause a deadlock because of softnet_lock. So we'll enable them when we remove softnet_lock in the future.
2016-07-07Switch the address list of intefaces to pslist(9)ozaki-r
As usual, we leave the old list to avoid breaking kvm(3) users.
2016-07-05Fix psref isn't released in a case of IFADDR_EMPTYozaki-r
2016-06-16Use curlwp_bind and curlwp_bindx instead of open-coding LP_BOUNDozaki-r
2016-06-15Protect if_byindex by pserializeozaki-r
2016-05-12Protect ifnet list with psz and psrefozaki-r
The change ensures that ifnet objects in the ifnet list aren't freed during list iterations by using pserialize(9) and psref(9). Note that the change adds a pslist(9) for ifnet but doesn't remove the original ifnet list (ifnet_list) to avoid breaking kvm(3) users. We shouldn't use the original list in the kernel anymore.
2015-07-24Unused inits (harmless).maxv
Found by Brainy.
2015-05-24convert remaining linux_get_sa() users to use linux_get_sa_sb() andrtr
pass the pointer to the sockaddr in msghdr.msg_name, while removing the MSG_NAMEMBUF flag. now that the original linux_get_sa() is unused remove it and to make function names consistent again rename linux_get_sa_sb() to linux_get_sa().
2015-05-02make connect syscall use sockaddr_big and modify pr_{send,connect}rtr
nam parameter type from buf * to sockaddr *. final commit for parameter type changes to protocol user requests * bump kernel version to 7.99.15 for parameter type changes to pr_{send,connect}
2015-04-03* change pr_bind to accept struct sockaddr * instead of struct mbuf *rtr
* update protocol bind implementations to use/expect sockaddr * instead of mbuf * * introduce sockaddr_big struct for storage of addr data passed via sys_bind; sockaddr_big is of sufficient size and alignment to accommodate all addr data sizes received. * modify sys_bind to allocate sockaddr_big instead of using an mbuf. * bump kernel version to 7.99.9 for change to pr_bind() parameter type. Patch posted to tech-net@ http://mail-index.netbsd.org/tech-net/2015/03/15/msg005004.html The choice to use a new structure sockaddr_big has been retained since changing sockaddr_storage size would lead to unnecessary ABI change. The use of the new structure does not preclude future work that increases the size of sockaddr_storage and at that time sockaddr_big may be trivially replaced. Tested by mrg@ and myself, discussed with rmind@, posted to tech-net@
2014-11-26Tweak ifconf variantsozaki-r
The tweaks make the code intention clear and make further changes easy. No functional change.
2014-11-21Tweak linux_getifhwaddrozaki-r
No functional change.
2014-11-09Do not uselessly include <sys/malloc.h>.maxv
2014-05-23Add a funtion that translate socket type value from Linux to NetBSD.njoly
Use it for socket and socketpair syscalls.
2014-05-17Replace open-coded access (and boundary checking) of ifindex2ifnet withrmind
if_byindex() function.
2014-01-27Add basic IPV6 level socket options support (IPV6_V6ONLY).njoly
2014-01-27Add SO_SNDLOWAT, SO_RCVLOWAT and SO_ACCEPTCONN support for socketnjoly
options.
2013-01-11Use copyin/copyout and linux-specific ifreq structures (they are the samechristos
as the netbsd ones, but this disconnects them)
2012-06-20print proper ktruser names depending on the emulation.christos
2012-03-15Do not read past end of array. Found by gcc -03bouyer
2012-01-20Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressionsjoerg
again. This was changed in sys/socket.h r1.51 to work around fallout from the IPv6 aux data migration. It broke the historic ABI on some platforms. This commit restores compatibility for netbsd32 code on such platforms and provides a template for future changes to the CMSG_* alignment. Revert PCC/Clang workarounds in postfix and tmux.
2011-12-20- Eliminate so_nbio and turn it into a bit SS_NBIO in so_state.christos
- Introduce MSG_NBIO so that we can turn non blocking i/o on a per call basis - Use MSG_NBIO to fix the XXX: multi-threaded issues on the fifo sockets. - Don't set SO_CANTRCVMORE, if we were interrupted (perhaps do it for all errors?).
2011-07-17fail early on socket domain+type combinations we don't supportchristos
2011-06-30dependant -> dependentwiz
2010-11-02update linux_sys_socket() to understand the flags that are nowchs
included in the "type" parameter. in linux_sys_sendmsg(), if we see an SCM_CREDENTIALS control message, just drop it instead of giving an error. the linux and native versions of the cred-passing operation are very different and some apps (eg. linux pulseaudio library talking to a native server) will work without the control data.
2009-11-28Add LINUX_SIOCGIFMTU and LINUX_IP_HDRINCL support.dsl
Fixes part of PR/31358 The other parts are rather too intrusive to be fixed as in the PR.
2009-11-13Return the result of copyout. Reminded by Niolas Joly.joerg
2009-11-13Provide SIOCGIFNAME.joerg
2009-06-17Add a new linux_msghdr structure, as its size differs on 64bit archs.njoly
Do the needed conversions in sendmsg/recvmsg syscalls, and adjust their definitions accordingly.
2009-06-16Add LINUX_CMSG_{SPACE,LEN} macros. Use then when calculating thenjoly
msg_controllen size, when converting the control message buffer from native (previous version was missing the linux_cmsghdr size).
2009-06-16For linux cmsg header copyout, use the linux structure size, not thenjoly
native one.
2009-06-16Make compat linux sendmsg/recvmsg output msghdr and control messagesnjoly
buffers with ktrace(1), just like the native functions.
2009-06-11In sendmsg(2), do copy the msghdr structure before trying to use it.njoly
2008-11-19Make the emulations, exec formats, coredump, NFS, and the NFS serverad
into modules. By and large this commit: - shuffles header files and ifdefs - splits code out where necessary to be modular - adds module glue for each of the components - adds/replaces hooks for things that can be installed at runtime
2008-08-06Convert socket options code to use a sockopt structureplunky
instead of laying everything into an mbuf. approved by core
2008-07-03Fix SIOCGIFCONF ioctl for 64bit platforms. Add a new linux_ifreqnjoly
structure and linux_getifconf function (cleaned up version from compat_ifconf). While here, update linux_getifhwaddr to use the new structure. Ok by christos.
2008-06-24Replace references to getsock/getvnode.ad
2008-06-11In linux_sys_sendto, do not unconditionnally set MSG_NAMEMBUF tonjoly
msg_flags; add it only if a target adress was provided and needs to be converted.
2008-06-09Do set mbuf in all cases, even for salen value of 0; otherwise thisnjoly
will make a panic later when trying to free memory from a random adress. XXX Need to revisit it later to avoid mbuf allocation in this case.
2008-04-29In linux_get_sa(), make salen parameter unsigned.njoly
Avoid kernel DIAGNOSTIC 0 bytes uvm mapping assertion, for negative values.
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-24Merge the socket locking patch:ad
- Socket layer becomes MP safe. - Unix protocols become MP safe. - Allows protocol processing interrupts to safely block on locks. - Fixes a number of race conditions. With much feedback from matt@ and plunky@.
2008-04-23Fix locking.ad
2008-03-26- Remove uneeded splsoftnet().ad
- Use fd_getsock().