Commit Graph

832 Commits

Author SHA1 Message Date
Gregory Nutt 63071a563a Costmetic changes 2015-08-27 10:38:43 -06:00
Gregory Nutt b1e09d4847 net/socket and net/tcp: Fix a problem in whent there are multiple network devices. Polls were being sent to all TCP sockets before. This is not good because it means that packets may sometimes be sent out on the wrong device. That is inefficient because it will cause retransmissions and bad performance. But, worse, when one of the devices is not Ethernet, it will have a different MSS and, as a result, incorrect data transfers can cause crashes. The fix is to lock into a single device once the MSS is locked locked down. 2015-08-27 09:06:46 -06:00
Gregory Nutt 3bcdb218ff Networking: Get rid of the tcp_mss macro. It is confusing and only obfuscates what is really going on 2015-08-27 08:39:17 -06:00
Gregory Nutt 007aabc46f Fix a badly formatted comment 2015-08-26 19:18:04 -06:00
SaeHie Park a268e0aeb9 Fix a typo from an earlier commit 2015-08-26 18:12:58 -06:00
Saehie ParK e6dbd3d903 Networking: Fix network device name assignment logic for the case of the local loopback device. There is only one local loopback network device and it is unnumbered 2015-08-25 20:03:25 -06:00
Anton D. Kachalov b125c36849 Field `d_sndlen' is unsigned. It is always >= 0.
Signed-off-by: Anton D. Kachalov <mouse@yandex-team.ru>
2015-08-26 00:16:52 +03:00
SaeHie Park e983e547e1 Networking: Correct return value from psock_tcp_accept(). From SaeHie Park 2015-08-25 07:15:21 -06:00
Gregory Nutt 79aa3d40b0 Kconfig: CONFIG_NET_MULTILINK and CONFIG_NET_MULTINIC must be support if the loopback device and any real network device are selected 2015-08-25 06:51:15 -06:00
Gregory Nutt 3c5f817513 Networking: Local loopback is basically functional and is no longer EXPERIMENTAL 2015-08-24 13:58:57 -06:00
Gregory Nutt 933d74e5c1 Networking: With these changes, I can ping the local loopback device from the simulator 2015-08-24 13:49:12 -06:00
Gregory Nutt 0b012c7978 Fix some initial loop back device compilation errors; mark configuration as EXPERIMENTAL 2015-08-24 11:29:54 -06:00
Gregory Nutt 07bdff9ef7 Networking: Add NetDB support for the local loopback device 2015-08-24 10:08:26 -06:00
Gregory Nutt e21501c699 Merge remote-tracking branch 'origin/master' into localhost 2015-08-24 08:29:36 -06:00
Gregory Nutt 569ff602ea Networking: Remove bogus references to PPP as a link layer protocol 2015-08-24 08:29:07 -06:00
Gregory Nutt ea2fafb024 Add definitions to support a local loopback link layer 2015-08-24 08:25:08 -06:00
Gregory Nutt 89b5ef8d35 wdogs: Fix counting of free, pre-allocated wdog timers. The could could get decremented below zero in some situations 2015-08-21 11:30:22 -06:00
Pavel Pisa 12b1c04508 recvfrom(): Correct wait for new data when NET_UDP_READAHEAD is enabled. Fix size accounting when recvfrom_udpreadahead() sets state.rf_recvlen == -1. I have not checked if data are accumulated to the right position in the buffer however.
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2015-08-21 09:15:06 -06:00
Gregory Nutt 4c4868c69f More cosmetic changes: Fix some errors in comments and some indentation problems 2015-08-11 19:23:51 -06:00
Gregory Nutt 850225223d Costmetic fix to a comment 2015-08-11 19:21:15 -06:00
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 f94fe747ae Undo part of a previous change. Move get/sethostname back from net/netdb to libc/unistd 2015-07-08 11:11:52 -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 6380832ab7 Move the header of set/sethostname from libc/unisted to net/netdb. This is OS internal stuff 2015-07-05 10:43:37 -06:00
Stavros Polymenis 701509f9bd Add implementations of uname() and gethost(). From Stavros Polymenis. 2015-07-03 07:50:27 -06:00
Gregory Nutt 09c7373f24 Fix misc. compilation error/warning detected by tools/testbuild.sh 2015-07-01 14:33:37 -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 8f7752d956 Networking: Modify how callback structures are stored to avoid another potential use of a stal pointer. 2015-06-03 08:11:57 -06:00
Gregory Nutt edbb5d0840 networking: Correct a typo introduced with recent networking changes 2015-06-02 15:04:02 -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 6687e156e6 Revamp last change. IFF_UP only required when allocating callback, not freeing. 2015-05-30 21:13:58 -06:00
Gregory Nutt 28b46c7bfa To be valid, a network device must not only exist, but be in the UP state 2015-05-30 12:54:18 -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 933b95ac80 Forgot to add a file in the last commit 2015-05-30 09:17:46 -06:00
Gregory Nutt 04a661a97c TCP networking: Add support for network driver events 2015-05-30 09:12:27 -06:00
Gregory Nutt ab50e9d04d Networking: Get rid of g_ipv4_allzeroaddr and g_ipv4_alloneaddr. It is more efficient and more intuitive to use INADDR_ANY and INADDR_BROADCAST 2015-05-29 15:16:11 -06:00
Gregory Nutt 34509a9ad5 UDP should use dev=NULL if the address in the lookup is INADDR_ANY 2015-05-29 14:56:44 -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 fa8b7c19b7 Forgot to add a file in the last commit 2015-05-29 11:03:02 -06:00
Gregory Nutt f10fdf7ad4 Networking: Add a test to see a device pointer is still valid 2015-05-29 11:01:03 -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