Commit Graph

133 Commits

Author SHA1 Message Date
Gregory Nutt
530d229361 net/udp: Add support for send() with connected UDP sockets 2015-08-11 19:17:55 -06:00
Max Neklyudov
7d04104485 Networking: Allow receipt of empty UDP packets. From Max Neklyudov 2015-08-11 08:34:16 -06:00
Gregory Nutt
fca919f3d2 Networking: Fix some compilation issues noted with network is build with CONFIG_BUILD_KERNEL 2015-07-05 11:18:56 -06:00
Gregory Nutt
342f5fe33d Fix references to the no-longer-existent misc/ directory in comments, README files, and documentation 2015-06-28 08:08:57 -06:00
Gregory Nutt
0ad53183e1 Networking: Fix a compile problem introduced in NuttX-7.6 when CONFIG_NET_SENDFILE=y 2015-06-24 14:52:57 -06:00
Gregory Nutt
ed9c45bcef Networking: Fix compilation error if IPv6 is enabled 2015-06-17 15:00:04 -06:00
Gregory Nutt
e22deff1ab TCP connect. Move the location where the socket is marked as connected in order to avoid a potential race condition 2015-05-31 12:24:24 -06:00
Gregory Nutt
b493dde4cf TCP networking: In the TCP connection operation, it was trying to setup the network monitor BEFORE the socket was successfully connected. This, of course, has ALWAYS failed because the socket is not yet connected and the TCP state is not yet correct for a connected socket. However, because of other changes net_startmonitor(0 no returns a failure condition that causes worse problems when trying to connect. The fix is to move the logic that starts the network monitor to AFTER the socket has been successfully connected. 2015-05-31 11:35:28 -06:00
Gregory Nutt
a47a0d237c Costmetic changes to networking logic 2015-05-31 10:29:53 -06:00
Gregory Nutt
33085cb309 Networking: The network device list was protected by a re-entrant semaphore. With the recent change to support network device callback, the network stack needs to access the network device list too. Some drivers, however, run the network stack from the interrupt level -- this is bad but a fact in the current state. Of course,those drivers are unable to take the semaphore and will assert.
The solution here is to eliminate the device devices semaphore altogether.  This eliminates netdev_semtake() and netdev_semgive() and replaces them with net_lock() and net_unlock() which have larger scope as needed for this purpose.
2015-05-31 08:34:03 -06:00
Gregory Nutt
cc340aaa92 TCP networking: Since the network monitor now allocates a callback structure, it is critical to make sure that the networking monitor is stopped when the socket is closed or any other loss of connection. What was innocuous before would now be a memory leak 2015-05-30 11:49:55 -06:00
Gregory Nutt
8b029fbbee TCP networking: Hook the network monitor into the device event notification logic 2015-05-30 11:29:47 -06:00
Gregory Nutt
04a661a97c TCP networking: Add support for network driver events 2015-05-30 09:12:27 -06:00
Gregory Nutt
0bdf2d5360 UDP Networking: Misc fixes to get the last changes working + cleanup 2015-05-29 14:32:56 -06:00
Gregory Nutt
2102892e7b Fix missing file and some compilation errors from the last UDP committ 2015-05-29 10:45:41 -06:00
Gregory Nutt
e672bcebfd UDP Networking: Add support for device event notification for UDP transfers. 2015-05-29 10:21:06 -06:00
Gregory Nutt
e28a8b1416 Raw sockets: Correct some compile issues; better modularized device-related logic 2015-05-29 08:47:21 -06:00
Gregory Nutt
988fbf0dcc Merge branch 'master' of ssh://git.code.sf.net/p/nuttx/git into multinic
Conflicts:
	nuttx/ChangeLog
2015-05-29 08:15:17 -06:00
Gregory Nutt
5337176cdf Networking: setsockopt() fails when setting timeouts to values less that an 100 msec. That is because the timeout is limited to stops of 1 decisecond and because the conversion of structure timeval was truncating the microsecond remainder. The utility net_timeval2dsec now accespts and option to determin how it handles the remainder: truncate, discarding the remainder, use the remainder to round to the closed decisecond value, or use any non-zero remainder to the next larger whole decisecond value.
For the setsockopt() case, it will always use the final option.  This means that a time of zero (i.e., not timeout) can only occur if the value zero was explicated provided to setsockopt().
2015-05-29 07:17:15 -06:00
Gregory Nutt
b5c005d5a4 Merge remote-tracking branch 'origin/master' into multinic
Conflicts:
	nuttx/ChangeLog
2015-05-28 19:30:48 -06:00
Gregory Nutt
d319b7c6f0 Networking: PKT logic now uses the device event list 2015-05-28 12:40:05 -06:00
Gregory Nutt
01d176af76 net_startmonitor.c always returned zero. In the case where a socket has already been closed, it correctly handled the disconnetion event but still returned OK. Returning OK causes the callers of net_startmonitor to assume that the connection was okay, undoing the good things that net_startmonitor did and causing the socket to be marked as connected. This behavior was noted by Pelle Windestam. 2015-05-28 08:23:51 -06:00
Gregory Nutt
0e2b6929b4 Add function headers to prototypes in net/socket/socket.h 2015-05-28 07:26:03 -06:00
Gregory Nutt
b94321cfb4 Extend device specific callbacks to ICMPv6 and ARP. Fix some IPv6 compilation errors that have crept in 2015-05-27 11:39:44 -06:00
Gregory Nutt
00011d4766 Another newly missing semicolon after a debug assertion. Noted by Librae 2015-04-29 15:56:08 -06:00
Gregory Nutt
621eae86b1 Networking: If IPV6 is not enabled, an warning occurs for an unused variable, which is currently used inside the IPV6 block, but declared outside. From ObitalFox. 2015-04-27 11:28:28 -06:00
Gregory Nutt
3ba9dda227 socket: net_dupsd: Do not call sockfd_socket() twice. From Juha Niskanen 2015-03-12 08:11:08 -06:00
Gregory Nutt
db741dd695 Move some useful internal logic from recvfrom.c and udp_callback.c and put them in ip.h where they can be used more generally 2015-02-17 07:37:44 -06:00
Gregory Nutt
eb8f5e548f Purely cosmetic changes resulting from last review IPv6 UDP change 2015-02-16 15:23:02 -06:00
Gregory Nutt
3f5ff4b210 IPv4 mapping to IPv6 implementation. Just for UDP. From Macs Neklyudov 2015-02-16 14:33:58 -06:00
Gregory Nutt
d6704a1cd7 Suffer the consequences of moving struct timeval to its correct location 2015-02-15 15:18:35 -06:00
Gregory Nutt
005643de2c Networking: Fix a compilation error recently introduced into the raw packet logic 2015-02-11 09:30:30 -06:00
Gregory Nutt
b756df982d net/: Lots of build problems introduced into multiple NIC support. Many places where conditional logic based on CONFIG_NETDEV_MULTINIC is confused with CONFIG_NET_MULTILINK. Lots of code changed with IPv6 that was never compiled with MULTINIC enabled. Still some problem with parameter passing. 2015-02-09 18:15:34 -06:00
Gregory Nutt
a07a764d42 ICMPv6: Adds basic logic to support verification that we have the IPv6 address in the Neighbor Table. This feature is important because otherwise the first packet sent to a remote peer will fail (it will be replaced with a Neighbor Solicitation). 2015-02-02 13:44:31 -06:00
Gregory Nutt
0fc8d2fcc5 Unix domain: Add options to build in stream or datagram support separately 2015-01-31 07:58:51 -06:00
Gregory Nutt
6b8da59df6 Networking: Add fcntl support for Unix domain sockets and UDP sockets with read-ahead enabled 2015-01-30 14:41:09 -06:00
Gregory Nutt
62b706fa68 If a Unix domain socket is non-blocking, then the underlying FIFO should also be opened non-blocking 2015-01-30 12:43:37 -06:00
Gregory Nutt
f357ba6c80 Fix error just introduces into recvfrom. From Macs N. 2015-01-30 08:22:44 -06:00
Gregory Nutt
5736cf10af Networking: Separate TCP poll logic out of net/sockets/net_poll.c and move it into the new net/tcp/tcp_netpoll.c. 2015-01-30 07:25:01 -06:00
Gregory Nutt
de91d34a19 Networking: Separate out UDP poll logic from socket/net_poll.c into a new udp/udp_netpoll.c; Create a skeleton local/local_netpoll.c for future poll support on Unix domain sockets. 2015-01-30 07:09:25 -06:00
Gregory Nutt
6eda06888a Eliminate a warning 2015-01-30 06:39:23 -06:00
Gregory Nutt
ccc72edc0b Networking: Add UDP read-ahead support and support for poll/select on UDP sockets. From Macs N. 2015-01-30 06:08:26 -06:00
Gregory Nutt
7e7d228cd7 Update a comment 2015-01-30 05:40:28 -06:00
Gregory Nutt
7f95e4fb2c Networking: Fix a major TCP bug introduced with commit e71c09ce9777ff732cb60bd07fb43d85522f79d6. Some connection logic was reorder -- setting the socket got moved BEFORE the point where the check was made if the socket was already connected. The resulting behavior was odd: Telnet would connect, but then when you exit and reconnect, it would fail to connect. But then if try again, it would connect okay. So the symptom was connect-fail-connect-fail-... 2015-01-29 16:30:47 -06:00
Gregory Nutt
8b9958b7ba Fix two compilation errors that occur when Unix domain occurs an IPv6 are enabled 2015-01-29 12:31:29 -06:00
Gregory Nutt
0deca5b039 Unix domain: Various fixes to get apps/examplex/udgram working 2015-01-29 11:05:04 -06:00
Gregory Nutt
9abd8e2e64 Fix typo in conditional compilation 2015-01-29 10:08:16 -06:00
Gregory Nutt
f6bec26e53 Elminate some warnings with TCP and UDP are disabled 2015-01-29 09:33:45 -06:00
Gregory Nutt
1c8ddae655 Fix a typo in comments 2015-01-28 17:51:59 -06:00
Gregory Nutt
72ac79e7a1 Minor fixes after initial tests with apps/examples/udgram 2015-01-28 15:27:54 -06:00