aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common
AgeCommit message (Collapse)Author
2011-11-07erts: Remove dead code in efile_drvBjörn-Egil Dahlberg
2011-10-11Merge branch 'bjorn/some-configure-clean-ups'Björn Gustavsson
* bjorn/some-configure-clean-ups: erts/configure.in: Remove test for reversed setvbuf() arguments erts/configure.in: Remove broken support for System V erts/configure.in: Don't check for the presence of mach-o/dyld.h erts/configure.in: Remove useless --disable-fixalloc option
2011-09-28Merge branch 'dev' into majorRaimo Niskanen
2011-09-28Merge branch 'raimo/sctp-getsetopts-dev/OTP-9544' into devRaimo Niskanen
* raimo/sctp-getsetopts-dev/OTP-9544: erts,kernel: Bugfix - read SCTP socket options from right protocol layer erts: Fix bug SCTP send can only be called from controlling process
2011-09-20Merge branch 'dev' into majorHenrik Nord
Conflicts: erts/aclocal.m4 erts/include/internal/ethread_header_config.h.in
2011-09-19Merge branch 'raimo/sctp-getsetopts/OTP-9544' into ↵Raimo Niskanen
raimo/sctp-getsetopts-dev/OTP-9544 Conflicts: erts/emulator/drivers/common/inet_drv.c lib/kernel/test/gen_sctp_SUITE.erl
2011-09-19erts,kernel: Bugfix - read SCTP socket options from right protocol layerRaimo Niskanen
Socket options 'sndbuf', 'recbuf' and 'linger were read from the SCTP protocol layer instead of from the socket protocol layer. Conflicts: lib/kernel/test/gen_sctp_SUITE.erl
2011-09-19erts: Fix bug SCTP send can only be called from controlling processRaimo Niskanen
Conflicts: lib/kernel/test/gen_sctp_SUITE.erl
2011-09-15Fix misspelling of successfulTuncer Ayaz
2011-09-08erts/configure.in: Remove broken support for System VBjörn Gustavsson
If we are compiling on System V, the symbols NO_WEAK_PRAGMA and SOCKOPT_CONNECT_STAT are defined, but they are never used.
2011-08-08Merge branch 'dev' into majorHenrik Nord
2011-06-08Fix boundry error where files might get lostBjörn-Egil Dahlberg
2011-06-08Teach prim_file:list_dir/1,2 to use fname chunksBjörn-Egil Dahlberg
The efile driver will now use chunked data on list_dir. This will lessen the number of sends to prim_file and hence improve performance. This method is utilized in both direct and async cases.
2011-05-24inet: error if fd does not match socket domainMichael Santos
If an IPv4 fd is opened as an IPv6 socket, unexpected behaviour can occur. For example, if an IPv4 UDP socket is opened and passed into Erlang as an IPv6 socket, the first 3 bytes (corresponding to 1 byte representing the protocol family, 2 bytes set to the port) are stripped from the payload. The cause of the UDP payload truncation happens in inet_drv.c:packet_inet_input when a call to inet_get_address fails silently because the family is set to PF_INET6 but the buffer len is the size of an IPv4 struct sockaddr_in. Prevent this behaviour by checking that the protocol family of the file descriptor matches the family of the requested Erlang socket. {ok, S1} = gen_udp:open(0, [binary, inet]), {ok, FD} = inet:getfd(S1), {ok, Port} = inet:port(S1), {ok, S} = gen_udp:open(Port, [binary, {fd, FD}, inet6]), {ok, C} = gen_udp:open(0, [binary]), Msg = <<1,2,3,4,5>>, gen_udp:send(C, "127.0.0.1", Port, Msg), receive {udp, S, _, _, Msg} -> ok; {udp, S, _, _, NewMsg} -> {error, Msg, NewMsg} end. This test results in: {error,<<1,2,3,4,5>>,<<4,5>>} Thanks to Andrew Tunnell-Jones for finding the bug and the test case!
2011-05-17Remove compiler warnings in inet_drvBjörn-Egil Dahlberg
2011-05-02inet_drv: remove unused tcp request idTuncer Ayaz
2011-05-02inet_drv: remove gratuitous assignmentTuncer Ayaz
2011-04-29Merge branch 'ms/unsigned-integer-overflow-in-error' into devHenrik Nord
* ms/unsigned-integer-overflow-in-error: Unsigned integer may overflow in error message OTP-9251
2011-04-07file: fix hang reading compressed filesMichael Santos
The gzio driver goes into an infinite loop when reading past the end of a compressed file. Reported-By: Alex Morarash
2011-04-07Unsigned integer may overflow in error messageMichael Santos
2011-03-21Teach tcp_recv not to cancel send timerPatrik Nyblom
2011-03-11Update copyright yearsBjörn-Egil Dahlberg
2011-02-21Add patch from Per HedelandPatrik Nyblom
Per H @ Tail-f: The original code here had problems that possibly only occur if you abuse it for non-INET sockets, but anyway: a) If the getsockopt for SO_PRIORITY or IP_TOS failed, the actual requested setsockopt was never even attempted. b) If {get,set}sockopt for one of IP_TOS and SO_PRIORITY failed, but ditto for the other worked and that was actually the requested option, failure was still reported to erlang.
2011-02-21Ignore permission error when implicitly setting SO_PRIORITYPatrik Nyblom
2011-01-12Remove strange name field in efile_drv.c as it upsets -D_FORTIFY_SOURCEPatrik Nyblom
2010-12-14Fix segfault for NULL return value fields from getifaddrs()Raimo Niskanen
2010-12-03Merge branch 'pan/inet6_corrections/OTP-8969' into devRaimo Niskanen
* pan/inet6_corrections/OTP-8969: Stop using uncertain flags for getaddrinfo() Teach inet_test_lib to understand enetunreach Make windows inet_gethost work for ipv6
2010-12-02Stop using uncertain flags for getaddrinfo()Raimo Niskanen
The AI_V4MAPPED flag is falling out of grace in modern IPv6 stacks, for security reasons, e.g. FreeBSD do not document it any longer. The AI_ADDRCONFIG flag have got unclear semantics on the same OS.
2010-11-30Adapt inet_drv to Visual Studio 2008Patrik Nyblom
2010-11-30Teach spawn_executable about UnicodePatrik Nyblom
Also corrected compressed files on Windows
2010-11-30Make Unicode filenames work on WindowsPatrik Nyblom
2010-11-30Handle binary file names and conversion of unicode stringsPatrik Nyblom
2010-11-22Merge branch 'rickard/thr-spec-inet-buf/OTP-8916' into devRickard Green
* rickard/thr-spec-inet-buf/OTP-8916: Remove tight restrictions on some options Thread specific inet driver buffer stack
2010-11-18Remove tight restrictions on some optionsRickard Green
Remove tight restrictions on the high_watermark, low_watermark, and buffer options.
2010-11-18Thread specific inet driver buffer stackRickard Green
The inet driver internal buffer stack implementation has been rewritten in order to reduce lock contention.
2010-11-09Delete decommented codeRaimo Niskanen
2010-11-09Implement inet:getifaddrs/0 on WindowsRaimo Niskanen
2010-11-09Implement basic inet:getifaddrs/0Raimo Niskanen
2010-11-09Fix building error of SCTP in FreeBSD 7.1 and laterKenji Rikitake
This patch fixes building error of SCTP in FreeBSD 7.1 and later. See http://www.erlang.org/cgi-bin/ezmlm-cgi?2:mss:1257:200904:hppnfialjjdlgecdiehe for the details. R13A patch for solving a compilation error when building erts/emulator/drivers/common/inet_drv.c by Kenji Rikitake 12-APR-2009 Symptom solved by this patch: When building R13A in FreeBSD 7.1-RELEASE, the compiler flag HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY is NOT enabled. Some code in erts/emulator/drivers/common/inet_drv.c incorrectly assumes HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY is always true when HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_FLAGS is true in config.h. This assumption causes a compilation error.
2010-09-09Make gen_tcp:recv/2 consistent with ssl:recv/2Björn Gustavsson
When the HTTP packet mode has been enabled for a socket, the ssl and gen_tcp modules have different error indications when there is an error while parsing the HTTP header: ssl:recv(SSLSocket, 0) -> {ok, {http_error, _Str}} gen_tcp:recv(Socket, 0) -> {error, {http_error, _Str}} We have decided to change gen_tcp:recv/2 to behave the same way as ssl:recv/2. That means that there will be always be an ok tuple if data could be succefully read from the socket, and an error tuple if there was a read error at the socket level.
2010-09-06Merge branch 'ms/inet-bug-fixes' into devBjörn Gustavsson
* ms/inet-bug-fixes: inet: support retrieving MAC address on BSD inet: fix getservbyname buffer overflow inet: fix ifr_name buffer overflow inet: null terminate ifr_name buffer OTP-8816
2010-09-03inet: support retrieving MAC address on BSDMichael Santos
On systems supporting getaddrinfo(), support looking up the MAC address from inet:ifget/2. The results have the same quirks as with Linux: if the MAC address is longer than 6 bytes (e.g., fw0 under Mac OS X), the address is truncated; if the interface does not have a MAC address (e.g., lo0), an address consisting of 0's is returned.
2010-09-02Merge branch 'rani/sctp-sndrcvinfo/OTP-8795' into devRaimo Niskanen
* rani/sctp-sndrcvinfo/OTP-8795: Fix xfer_active close expection for Solaris behaviour Keep default #sctp_sndrcvinfo{} fields on gen_sctp:send/4 Fill in sinfo_assoc_id in struct sctp_sndrcvinfo for getopt() Conflicts: lib/kernel/test/gen_sctp_SUITE.erl
2010-08-31Fill in sinfo_assoc_id in struct sctp_sndrcvinfo for getopt()Raimo Niskanen
The assoc_id field was uninitialized causing random answers.
2010-08-31Fix SCTP linger optionRaimo Niskanen
inet:setopts(S, [{linger,{true,2}}]) returned {error,einval} for SCTP sockets. The inet_drv had a bug when checking the option size.
2010-08-17erts: Remove stray pre-ISO-C compatibility macrosBjörn Gustavsson
A long time ago, the Erlang run-time system could be build with pre-ANSI/ISO-C (K&R) C compilers, but that is no longer possible. Remove the remaining uses of the compatibility macros that made it possible that possible.
2010-07-26inet: fix getservbyname buffer overflowMichael Santos
The byte holding the length of the interface name for the getservbyname/2 function is used in a signed context and can become negative, causing the buffer to be overrun. Make the same change for getservbyport/2. Test case: inet:getservbyname(list_to_atom(lists:flatten(lists:duplicate(128, "x"))), tcp).
2010-07-26inet: fix ifr_name buffer overflowMichael Santos
The byte holding the length of the interface name for the ifget/2 functions is used in a signed context and can become negative, causing the ifreq.ifr_name buffer to be overrun. Test case: inet:ifget(lists:duplicate(128, "x"), [addr]).
2010-07-26inet: null terminate ifr_name bufferMichael Santos
The buffer holding the interface name should be null terminated. See man 7 socket on Linux or the definition of IFNAMSIZ in net/if.h on FreeBSD: Length of interface external name, including terminating '\0'.
2010-07-07Fix inet_drv to detect passive mode UDP errors for SCTP buildsRaimo Niskanen
Debug and patch by Per Hedeland for R13B04 on erlang-patches: Connected UDP (and handling of any other errors in UDP recv()) is broken in passive mode for all SCTP-enabled builds.