Commit Graph

2099 Commits

Author SHA1 Message Date
Xiang Xiao
9523d4bea4 net/local: Remove local_send.c since nobody use it now
Forget to remove in:
commit e223f60c09
Author: Peter Bee <bijunda1@xiaomi.com>
Date:   Tue Dec 1 14:55:16 2020 +0800

    net/socket: move si_send/recv into sendmsg/recvmsg

    Implement si_send/sendto/recvfrom with si_sendmsg/recvmsg, instead of
    the other way round.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-12 16:42:52 -03:00
Peter Bee
6f995e377c fix local_sendmsg return length
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2021-03-12 21:04:39 +08:00
Masayuki Ishikawa
e65d5d8c73 Revert "net: tcp: Add DEBUGASSERT() in psock_tcp_send()"
Summary:
- Based on the discussion (PR#2772), let me revert the commit

Impact:
- None

Testing:
- N/A

This reverts commit ec8bf5c8c1.

Suggested-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-03-12 16:23:01 +08:00
Gustavo Henrique Nihei
330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Gustavo Henrique Nihei
47cb41c92f makefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
ligd
70442d1f9d net/socket_rpmsg: add net socket rpmsg support
Change-Id: Ie23ee4c0052cf2fc66972ea9bc5f11c070fbcf8a
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-07 01:45:51 -08:00
Peter Bee
e223f60c09 net/socket: move si_send/recv into sendmsg/recvmsg
Implement si_send/sendto/recvfrom with si_sendmsg/recvmsg, instead of
the other way round.

Change-Id: I7b858556996e0862df22807a6edf6d7cfe6518fc
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2021-03-05 04:46:13 -08:00
Jiuzhu Dong
4d5a964f29 net: unify socket into file descriptor
Change-Id: I9bcd21564e6c97d3edbb38aed1748c114160ea36
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-03 19:01:41 -08:00
Xiang Xiao
8d0fd4038b Remove the empty xxx_initialize functions
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I63cb6b37f78e910663724659e11f53e3335d419f
2021-03-03 08:21:04 +00:00
Xiang Xiao
9473434587 Ensure the kernel component don't call userspace API
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-01 09:23:09 +09:00
Gustavo Henrique Nihei
76acb32e29 Fix typos reported by codespell 2021-02-25 11:31:49 -08:00
Alin Jerpelea
37d5c1b0d9 net: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-20 00:38:18 -08:00
Alin Jerpelea
7dc7ef45f1 net: nxstyle fixes
Nxstyle fixes to pass CI.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-20 00:38:18 -08:00
Xiang Xiao
1a9267db65 net/local: Add an option to specify the prefix of named pipe
to avoid the user create socket under the real filesystem
which isn't supported by nuttx VFS yet.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib04c90e9c3c5a215bfda65515498d81e5f834895
2021-02-05 04:58:12 -08:00
Peter van der Perk
22437698f1 [imxrt] Fix FlexCAN tx dropping frames 2021-02-02 17:51:29 -03:00
chao.an
38e2c4ba53 net/ip: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-30 16:04:39 -08:00
chao.an
ab148bc69f net/ip: do not drop the udp packet from IP layer
this change to support receive the udp data from the specified
port without obtaining the address.

e.g: disable the Bootstrap flag on dhcpc handshake

Reference:
RFC1542: Clarifications and Extensions for the Bootstrap Protocol.

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-30 16:04:39 -08:00
Masayuki Ishikawa
ec8bf5c8c1 net: tcp: Add DEBUGASSERT() in psock_tcp_send()
Summary:
- This commit adds DEBUGASSERT() to check the IOB size

Impact:
- None

Testing:
- Tested with sabre-6quad:netnsh with QEMU

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-01-29 00:05:01 -08:00
Abdelatif Guettouche
7e3d4a5f29 net: Remove duplicate forward references.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-01-16 07:39:04 -08:00
Abdelatif Guettouche
6385408483 net/: Correct some comments.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-01-15 16:23:12 -05:00
Abdelatif Guettouche
8e4397968c net/ & esp32/wlan: Fix some typos and nxstyle issues.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-01-14 07:57:27 -06:00
Xiang Xiao
0dc6990166 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-01-13 08:57:58 +01:00
Xiang Xiao
0536953ded Kernel module should prefer functions with nx/kmm prefix
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-01-13 08:57:58 +01:00
chao.an
ae5b727580 net/tcp/handshake: send the SYN immediately.
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-18 14:16:11 +09:00
chao.an
5e9e50991c net/tcp: send the ack on nonblock mode
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-18 14:16:11 +09:00
Juha Niskanen
de1ad1fdb3 net: fix typos, incorrect comments, nxstyle
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-12-13 09:06:28 -06:00
John Bampton
ba12c6c0cf Fix spelling 2020-12-12 19:18:08 +01:00
chao.an
8d0118569c [Performance]net/tcp: send the ACK in time after obtain ahead buffer from iobs
Request the TCP ACK to estimate the receive window after handle
any data already buffered in a read-ahead buffer.

Change-Id: Id998a1125dd2991d73ba4bef081ddcb7adea4f0d
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-10 12:23:47 +09:00
chao.an
881dd9d62d net/tcp: add a member to record the current receiving window
Change-Id: Ic4c46d643a905fdd3a828e563eab4814da70dbe5
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-10 12:23:47 +09:00
chao.an
794a6ec23d net/tcp: rename the winszie to snd_wnd to make the semantics more accurate
Change-Id: I8fdc7cf78a7f2cd53a30ef1de702b1a697c43238
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-10 12:23:47 +09:00
Brennan Ashton
68b526b335 tcp: Remove incomplete support for TCP reassembly 2020-12-09 07:25:26 -08:00
Gregory Nutt
45699e2701 net/tcp/tcp_input.c: Correct bad check of urgent data length
Urgent data preceded "normal" data in the TCP payload.  If the urgent data is larger than the size of the TCP payload, this indicates that the entire payload is urgent data and that urgent data continues in the next packet.

This case was handled correctly for the case where urgent data was present but was not being handled correctly in the case where the urgent data was NOT present.
2020-12-09 07:25:14 -08:00
chao.an
e37001f269 net/setsockopt/IP_MULTICAST_TTL: add handles of different prototypes
Reference here:
b3298500b2/net/ipv4/ip_sockglue.c (L923-L932)

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-05 10:44:53 -08:00
chao.an
5ad2c931a3 net/inet: fix nxstyle warnings
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-05 10:44:53 -08:00
chao.an
4af687b8c2 net/igmp: add MULTICAST_TTL support
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-05 10:44:53 -08:00
YAMAMOTO Takashi
87f93071e0 net/sixlowpan/sixlowpan_icmpv6send.c: Fix a syslog format 2020-12-05 08:13:32 -06:00
YAMAMOTO Takashi
3f57667647 net/sixlowpan/sixlowpan_icmpv6send.c: Appease nxstyle 2020-12-05 08:13:32 -06:00
YAMAMOTO Takashi
cee4261c0d net/tcp/tcp_sendfile.c: Fix syslog formats 2020-12-05 08:13:32 -06:00
chao.an
dbd6e9be16 net/procfs: handle opendir("/proc/net/") correctly
Change-Id: I092bade082ba673b30257add4f869ac5bfa55ca6
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-03 05:56:35 -06:00
chao.an
ad66ea51e5 net/igmp: fix nxstyle warning
Change-Id: I6bb84038e035b81ea66b128ebf109f4a392ee6ab
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-03 12:23:04 +01:00
chao.an
ab78bae12f net/igmp: add sanity check to handle allocate fail
Change-Id: Ia3128c9c2b219345fb6ac2789ece7760c6aee663
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-03 12:23:04 +01:00
chao.an
316cdccf82 net/sockopt: Try usrsock further if the protocol not available
fallback to usrsock if the features are not implemented locally

Change-Id: I46e2d6452d7edd3fa5b3d508945511cd48f22ebb
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-03 12:22:48 +01:00
chao.an
51efe468b9 net/sockopt: fix invalid option set
fix invalid option set if enable UDP without TCP

Change-Id: I732893501a9b28749706d6f860c77ae9e14b358c
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-03 12:22:48 +01:00
YAMAMOTO Takashi
7c46aface0 net/sixlowpan/sixlowpan_udpsend.c: Fix a syslog format 2020-12-02 02:53:47 -06:00
YAMAMOTO Takashi
e4760ca93b net/sixlowpan/sixlowpan_tcpsend.c: Fix syslog formats 2020-12-02 02:53:47 -06:00
chao.an
c2b0006dcd net/tcp: implement the fast retransmit
RFC2001: TCP Slow Start, Congestion Avoidance, Fast Retransmit,
         and Fast Recovery Algorithms

...

3.  Fast Retransmit
  Modifications to the congestion avoidance algorithm were proposed in
  1990 [3].  Before describing the change, realize that TCP may
  generate an immediate acknowledgment (a duplicate ACK) when an out-
  of-order segment is received (Section 4.2.2.21 of [1], with a note
  that one reason for doing so was for the experimental fast-
  retransmit algorithm).  This duplicate ACK should not be delayed.
  The purpose of this duplicate ACK is to let the other end know that a
  segment was received out of order, and to tell it what sequence
  number is expected.

  Since TCP does not know whether a duplicate ACK is caused by a lost
  segment or just a reordering of segments, it waits for a small number
  of duplicate ACKs to be received.  It is assumed that if there is
  just a reordering of the segments, there will be only one or two
  duplicate ACKs before the reordered segment is processed, which will
  then generate a new ACK.  If three or more duplicate ACKs are
  received in a row, it is a strong indication that a segment has been
  lost.  TCP then performs a retransmission of what appears to be the
  missing segment, without waiting for a retransmission timer to
  expire.

Change-Id: Ie2cbcecab507c3d831f74390a6a85e0c5c8e0652
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-01 11:36:10 -06:00
chao.an
234d3df19f net/tcp: correct the available iobs count if throttle is enabled
The number of available iobs is already sub in iob_navail(true) on line 114

net/tcp/tcp_recvwindow.c:
...
 73 uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev)
...
114   niob_avail    = iob_navail(true);

Change-Id: I230927904d8db08ed8d95d7fa18c5c5fce08aa5e
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 23:24:44 -06:00
chao.an
049c991d28 style/Kconfig: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
chao.an
c56785bd0d style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
chao.an
4305718691 net/tcp: fix nxstyle warnings
Change-Id: Id885fefc80caa12806c73778e632c8b0c5888be0
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 00:03:47 -06:00