Commit Graph

2314 Commits

Author SHA1 Message Date
chao.an
1f4de9e13c net/icmp: replace the common connect prologue
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-10 15:04:33 -03:00
chao.an
f7bf28deac net/usrsock: replace the common connect prologue
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-10 15:04:33 -03:00
chao.an
69c4f6651e net/netlink: replace the common connect prologue
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-10 15:04:33 -03:00
chao.an
39e142243d net/tcp/udp: move the send callback into tcp/udp structure
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-10 15:04:33 -03:00
chao.an
b16e022ead netdev/lladdrsize: remove invalid duplicate case
error:
--------------------------------------
netdev/netdev_lladdrsize.c: In function ‘netdev_lladdrsize’:
netdev/netdev_lladdrsize.c:148:7: error: duplicate case value
  148 |       case NET_LL_BLUETOOTH:
      |       ^~~~
netdev/netdev_lladdrsize.c:119:7: note: previously used here
  119 |       case NET_LL_BLUETOOTH:
      |       ^~~~

BLUETOOTH_HDRLEN has been removed by:
---------------------------------
|commit aae0d92598
|Author: Gregory Nutt <gnutt@nuttx.org>
|Date:   Sun Apr 1 15:21:58 2018 -0600
|
|wireless/bluetooth and net/bluetooth:
|
|Clean up some garbage left in Kconfig file that broke 'make menuconfig'.
|Clean up some craziness with Bluetooth frame length definitions.

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-07 20:08:26 +08:00
chao.an
83f8996c39 net/sixlowpan: fix compile warning
sixlowpan/sixlowpan_input.c: In function ‘sixlowpan_dispatch’:
sixlowpan/sixlowpan_input.c:629:3: warning: implicit declaration of function ‘pkt_input’;
                                   did you mean ‘ipv6_input’? [-Wimplicit-function-declaration]
  629 |   pkt_input(&radio->r_dev);
      |   ^~~~~~~~~
      |   ipv6_input

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-07 19:22:25 +08:00
chao.an
7480cc2835 net/devif: remove invalid NET_IPv4_REASSEMBLY definition
NET_IPv4_REASSEMBLY has been removed by:
--------------------------------------------------------
|  commit 68b526b335
|  Author: Brennan Ashton <bashton@brennanashton.com>
|  Date:   Tue Dec 1 22:59:00 2020 -0800
|
|      tcp: Remove incomplete support for TCP reassembly
--------------------------------------------------------

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-07 18:31:31 +08:00
Xiang Xiao
108a5004c5 net/local: Rename NET_LOCAL_PATH_PREFIX to NET_LOCAL_VFS_PATH
align with other similiar config which suffix with _VFS_PATH

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-06 19:42:00 +01:00
raiden00pl
bc178344a9 net/can: add an option to control CAN EXTID support 2022-02-06 17:09:11 +08:00
chao.an
56b5ae0640 net/tcp/netdev/mld: correct the netlock handling
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-03 11:09:18 -03:00
Alexander Lunev
b2f3cefe3d sim/netdev,tapdev: implemented emulation of TX done and RX ready interrupts
and removed two tcp_send_txnotify() calls from tcp_sendfile (they are not needed anymore).

As a result, the TX throughput of both the tcp_send_buffered and tcp_send_unbuffered
is significantly boosted in case of TUN/TAP network device.
2022-01-28 18:16:42 +08:00
Alexander Lunev
2a6de301ee net/tcp: transformed NET_TCP_FAST_RETRANSMIT_WATERMARK option to boolean.
According to RFC 5681 (3.2) the TCP Fast Retransmit algorithm should start
if the threshold of 3 duplicate ACKs is reached.
Thus the threshold should be a constant, not an integer option.
2022-01-26 11:50:48 +08:00
Alexander Lunev
8be9cb9f72 net/tcp/sendfile: notify the device driver of the availability of TX data on TCP retransmission
(as well as on sending normal TCP packets).
2022-01-26 02:01:25 +08:00
Alexander Lunev
7e748e63dd net/tcp/tcp_sendfile: optimized out sendfile_txnotify() function 2022-01-26 02:01:06 +08:00
Alexander Lunev
ad25c43983 net/tcp/sendfile: fast retransmit on duplicate acknowledgments (RFC 5681).
(the same as it was implemented in tcp_send_unbuffered.c)
2022-01-25 16:30:38 +08:00
Alexander Lunev
eec94132c4 net/tcp/sendfile: removed excessive overwrites of conn->sndseq
(conn->sndseq was updated in multiple places that was unreasonable and complicated).
This optimization is the same as it was done for tcp_send_unbuffered.
2022-01-22 00:43:53 +08:00
Alexander Lunev
338b122b2b net/tcp/sendfile: fixed an issue with unackseq calculation.
Wrong unackseq calculation locked conn->tx_unacked at non-zero values
even if all ACKs were received.
This issue is the same as it was with tcp_send_unbuffered.
2022-01-22 00:42:29 +08:00
Alexander Lunev
c9e32dd4a4 tcp: fixed warning: ISO C90 forbids mixed declarations and code 2022-01-22 00:41:42 +08:00
Alexander Lunev
64dd669749 net/tcp/sendfile: retransmit only one the earliest not acknowledged segment
(according to RFC 6298 (5.4)). The issue is the same as it was in tcp_send_unbuffered.c.
2022-01-20 18:37:39 +08:00
Petro Karashchenko
08043fb5bc net: unify FAR keyword usage for all net buffer memory mapped buffers
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-20 01:42:56 +08:00
chao.an
086fb829fd net/usrsock: fix build warning
usrsock/usrsock_sockif.c:72:3: warning:
initialization of ‘int (*)(struct socket **)’ from incompatible pointer type
‘int (*)(struct socket *, int,  void *, size_t)’ {aka ‘int (*)(struct socket *, int,  void *, long unsigned int)’} [-Wincompatible-pointer-types]
   72 |   usrsock_ioctl               /* si_ioctl */
      |   ^~~~~~~~~~~~~

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-19 12:09:53 +01:00
Alexander Lunev
6bb7a92a9a net/tcp/tcp_send*: added debug asserts for TCP_ACKDATA, TCP_REXMIT and TCP_DISCONN_EVENTS flags 2022-01-19 10:45:38 +08:00
Alexander Lunev
79e609a8c8 net/tcp/sendfile: swapped the location of TCP_DISCONN_EVENTS and TCP_ACKDATA conditions towards tcp_send_unbuffered.c unification 2022-01-19 00:13:38 +08:00
Petro Karashchenko
9551de7115 net: use HTONS, NTOHS, HTONL, NTOHL macro in kernel code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-18 10:59:47 +01:00
Alexander Lunev
5b13797cce net/tcp/tcp_send*: reliably obtain the TCP connection pointer in TCP event handlers
Do not use pvconn argument to get the TCP connection pointer because pvconn is
normally NULL for some events like NETDEV_DOWN. Instead, the TCP connection pointer
can be reliably obtained from the corresponding TCP socket.
2022-01-18 16:14:38 +08:00
Alexander Lunev
f61f276120 net/tcp/sendfile: TCP retransmission could not start because of incorrect snd_ackcb callback handling:
Both the snd_ackcb and snd_datacb callbacks were created and destroyed right after sending every packet.
Whenever TCP_REXMIT event occurred due to TCP send timeout, TCP_REXMIT was ignored because
snd_ackcb callback had been destroyed by the time.
The issue is fixed as follows:
- both the snd_ackcb and snd_datacb callbacks are combined into one snd_cb callback
  (the same way as in tcp_send_unbuffered.c).
- the snd_cb callback lives until all requested data (via sendfile) is sent,
  including all ACKs and possible retransmissions.

As a positive side effect of the code optimization / fix, sendfile TCP payload throughput is increased.
2022-01-18 02:03:40 +08:00
chao.an
a9d0dd7051 net/netlink: fix build warning if disable CONFIG_NETLINK_ROUTE
netlink/netlink_sockif.c: In function ‘netlink_sendmsg’:
netlink/netlink_sockif.c:676:10: warning: unused variable ‘len’ [-Wunused-variable]
  676 |   size_t len = msg->msg_iov->iov_len;
      |          ^~~

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-17 13:34:49 +08:00
chao.an
0d7f12c489 net/icmp: fix build break if enable NET_ALLOC_CONNS
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-17 13:34:49 +08:00
Alexander Lunev
0f080cdeaf net/tcp/sendfile: NET_TCP_WRITE_BUFFERS and NET_SENDFILE were inconsistent with each other:
tcp_sendfile() reads data directly from a file and does not use NET_TCP_WRITE_BUFFERS data flow
even if CONFIG_NET_TCP_WRITE_BUFFERS option is enabled.
Despite this, tcp_sendfile relied on NET_TCP_WRITE_BUFFERS specific flow control variables that
were idle during sendfile operation. Thus it was a total inconsistency.

E.g. because of the issue, TCP socket used by sendfile() operation never issued
FIN packet on close() command, and the TCP connection hung up.

As a result of the fix, simultaneously enabled CONFIG_NET_TCP_WRITE_BUFFERS and
CONFIG_NET_SENDFILE options can coexist.
2022-01-17 01:42:41 +08:00
Petro Karashchenko
8d3bf05fd2 include: fix double include pre-processor guards
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-16 11:11:14 -03:00
Alexander Lunev
8042de1145 net/devif/devif_callback.c: devif_callback_free() call is not needed anymore in devif_callback_alloc() 2022-01-06 22:47:18 +08:00
Xiang Xiao
e27962a997 net/devif: Fix the memory leak in case of netdev isn't alive
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-05 22:01:13 +08:00
raiden00pl
a8ca1ec026 SocketCAN: add CAN error definitions 2022-01-05 18:32:46 +08:00
chao.an
4603d108be net/usrsock: add support for CONFIG_NET_ALLOC_CONNS
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-05 12:39:00 +08:00
chao.an
cbe9352f41 net/usrsock: remove the connections limit
replace xid type to uint64_t to avoid connections limit

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-05 12:38:42 +08:00
chao.an
504f1d1b5f net/misc: add support for CONFIG_NET_ALLOC_CONNS
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-04 14:36:07 +08:00
chao.an
a1bf9ca88b net/icmp[v6]: add support for CONFIG_NET_ALLOC_CONNS
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-04 14:36:07 +08:00
raiden00pl
6185377eec net/devif/devif_cansend.c: fix assertion for max data len 2022-01-03 08:52:49 -03:00
raiden00pl
649619b8f8 net/can/can_recvmsg.c: fix warning 2022-01-03 08:52:49 -03:00
Xiang Xiao
43c28c4456 net/usrsock: Fix the compile warning
In file included from usrsock/usrsock_bind.c:32:
usrsock/usrsock_bind.c: In function ‘usrsock_bind’:
usrsock/usrsock_bind.c:183:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  183 |       nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                            |
      |                                                            ssize_t {aka long int}
usrsock/usrsock_bind.c:183:54: note: format string is defined here
  183 |       nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                                                     ~^
      |                                                      |
      |                                                      int
      |                                                     %ld
CC:  usrsock/usrsock_connect.c
CC:  usrsock/usrsock_dev.c
In file included from usrsock/usrsock_dev.c:37:
usrsock/usrsock_dev.c: In function ‘usrsockdev_handle_event’:
usrsock/usrsock_dev.c:488:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  488 |             nwarn("message too short, %d < %d.\n", len, sizeof(*hdr));
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                    |
      |                                                    size_t {aka long unsigned int}
usrsock/usrsock_dev.c:488:40: note: format string is defined here
  488 |             nwarn("message too short, %d < %d.\n", len, sizeof(*hdr));
      |                                       ~^
      |                                        |
      |                                        int
      |                                       %ld
In file included from usrsock/usrsock_dev.c:37:
usrsock/usrsock_dev.c:488:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
  488 |             nwarn("message too short, %d < %d.\n", len, sizeof(*hdr));
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       ~~~~~~~~~~~~
      |                                                         |
      |                                                         long unsigned int
usrsock/usrsock_dev.c:488:45: note: format string is defined here
  488 |             nwarn("message too short, %d < %d.\n", len, sizeof(*hdr));
      |                                            ~^
      |                                             |
      |                                             int
      |                                            %ld
In file included from usrsock/usrsock_dev.c:37:
usrsock/usrsock_dev.c: In function ‘usrsockdev_handle_datareq_response’:
usrsock/usrsock_dev.c:657:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  657 |       nwarn("%dth buffer not large enough (need: %d, have: %d).\n",
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
  660 |             conn->resp.datain.iov[iovpos].iov_len);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                          |
      |                                          size_t {aka long unsigned int}
usrsock/usrsock_dev.c:657:61: note: format string is defined here
  657 |       nwarn("%dth buffer not large enough (need: %d, have: %d).\n",
      |                                                            ~^
      |                                                             |
      |                                                             int
      |                                                            %ld
In file included from usrsock/usrsock_dev.c:37:
usrsock/usrsock_dev.c:678:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  678 |           nwarn("%dth buffer not large enough "
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
  682 |                 conn->resp.datain.iov[iovpos].iov_len);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                              |
      |                                              size_t {aka long unsigned int}
usrsock/usrsock_dev.c:679:45: note: format string is defined here
  679 |                 "(need: %" PRId32 ", have: %d).\n",
      |                                            ~^
      |                                             |
      |                                             int
      |                                            %ld
In file included from usrsock/usrsock_dev.c:37:
usrsock/usrsock_dev.c: In function ‘usrsockdev_handle_req_response’:
usrsock/usrsock_dev.c:745:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  745 |       nwarn("message too short, %d < %d.\n", len, hdrlen);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                              |
      |                                              size_t {aka long unsigned int}
usrsock/usrsock_dev.c:745:34: note: format string is defined here
  745 |       nwarn("message too short, %d < %d.\n", len, hdrlen);
      |                                 ~^
      |                                  |
      |                                  int
      |                                 %ld
In file included from usrsock/usrsock_dev.c:37:
usrsock/usrsock_dev.c: In function ‘usrsockdev_write’:
usrsock/usrsock_dev.c:858:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  858 |           nwarn("message too short, %d < %d.\n", len,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                  |
      |                                                  size_t {aka long unsigned int}
usrsock/usrsock_dev.c:858:38: note: format string is defined here
  858 |           nwarn("message too short, %d < %d.\n", len,
      |                                     ~^
      |                                      |
      |                                      int
      |                                     %ld
In file included from usrsock/usrsock_dev.c:37:
usrsock/usrsock_dev.c:858:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
  858 |           nwarn("message too short, %d < %d.\n", len,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  859 |                 sizeof(struct usrsock_message_common_s));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 |
      |                 long unsigned int
usrsock/usrsock_dev.c:858:43: note: format string is defined here
  858 |           nwarn("message too short, %d < %d.\n", len,
      |                                          ~^
      |                                           |
      |                                           int
      |                                          %ld
CC:  usrsock/usrsock_getpeername.c
In file included from usrsock/usrsock_getpeername.c:32:
usrsock/usrsock_getpeername.c: In function ‘usrsock_getpeername’:
usrsock/usrsock_getpeername.c:190:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  190 |       nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                            |
      |                                                            ssize_t {aka long int}
usrsock/usrsock_getpeername.c:190:54: note: format string is defined here
  190 |       nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                                                     ~^
      |                                                      |
      |                                                      int
      |                                                     %ld
CC:  usrsock/usrsock_event.c
CC:  usrsock/usrsock_getsockname.c
In file included from usrsock/usrsock_getsockname.c:32:
usrsock/usrsock_getsockname.c: In function ‘usrsock_getsockname’:
usrsock/usrsock_getsockname.c:190:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  190 |       nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                            |
      |                                                            ssize_t {aka long int}
usrsock/usrsock_getsockname.c:190:54: note: format string is defined here
  190 |       nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                                                     ~^
      |                                                      |
      |                                                      int
      |                                                     %ld
CC:  usrsock/usrsock_getsockopt.c
CC:  usrsock/usrsock_poll.c
CC:  usrsock/usrsock_recvmsg.c
In file included from usrsock/usrsock_recvmsg.c:32:
usrsock/usrsock_recvmsg.c: In function ‘usrsock_recvmsg’:
usrsock/usrsock_recvmsg.c:321:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  321 |               nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                                    |
      |                                                                    ssize_t {aka long int}
usrsock/usrsock_recvmsg.c:321:62: note: format string is defined here
  321 |               nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                                                             ~^
      |                                                              |
      |                                                              int
      |                                                             %ld
In file included from usrsock/usrsock_recvmsg.c:32:
usrsock/usrsock_recvmsg.c:343:24: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  343 |                   nerr("net_timedwait errno: %d\n", ret);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                     |
      |                                                     ssize_t {aka long int}
usrsock/usrsock_recvmsg.c:343:47: note: format string is defined here
  343 |                   nerr("net_timedwait errno: %d\n", ret);
      |                                              ~^
      |                                               |
      |                                               int
      |                                              %ld
In file included from usrsock/usrsock_recvmsg.c:32:
usrsock/usrsock_recvmsg.c:384:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  384 |           nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                                |
      |                                                                ssize_t {aka long int}
usrsock/usrsock_recvmsg.c:384:58: note: format string is defined here
  384 |           nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                                                         ~^
      |                                                          |
      |                                                          int
      |                                                         %ld
CC:  usrsock/usrsock_sendmsg.c
In file included from usrsock/usrsock_sendmsg.c:32:
usrsock/usrsock_sendmsg.c: In function ‘usrsock_sendmsg’:
usrsock/usrsock_sendmsg.c:302:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  302 |               nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                                    |
      |                                                                    ssize_t {aka long int}
usrsock/usrsock_sendmsg.c:302:62: note: format string is defined here
  302 |               nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                                                             ~^
      |                                                              |
      |                                                              int
      |                                                             %ld
In file included from usrsock/usrsock_sendmsg.c:32:
usrsock/usrsock_sendmsg.c:324:24: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  324 |                   nerr("net_timedwait errno: %d\n", ret);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                     |
      |                                                     ssize_t {aka long int}
usrsock/usrsock_sendmsg.c:324:47: note: format string is defined here
  324 |                   nerr("net_timedwait errno: %d\n", ret);
      |                                              ~^
      |                                               |
      |                                               int
      |                                              %ld
In file included from usrsock/usrsock_sendmsg.c:32:
usrsock/usrsock_sendmsg.c:364:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  364 |           nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                                |
      |                                                                ssize_t {aka long int}
usrsock/usrsock_sendmsg.c:364:58: note: format string is defined here
  364 |           nwarn("usrsock_setup_request_callback failed: %d\n", ret);
      |                                                         ~^
      |                                                          |
      |                                                          int
      |                                                         %ld

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-03 11:19:32 +08:00
Alexander Lunev
e9ab3adf23 net/tcp(unbuffered): advance sndseq by +1 because SYN and FIN occupy one sequence number (RFC 793) 2022-01-03 12:18:44 +09:00
Alexander Lunev
0afb1d8dbb net/tcp(unbuffered): fast retransmit on duplicate acknowledgments 2022-01-02 23:25:09 +08:00
chao.an
f345f3dc2e net/devif_callback: add support for CONFIG_NET_ALLOC_CONNS
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-02 01:25:14 +08:00
chao.an
3b490d4e3a net/icmp: post the semaphore if multiple references
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-02 01:23:23 +08:00
chao.an
26370cd2f7 net/udp: add support for CONFIG_NET_ALLOC_CONNS
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-01 20:40:02 +08:00
chao.an
38b7b3d26a net/tcp: add support for CONFIG_NET_ALLOC_CONNS 2022-01-01 20:40:02 +08:00
chao.an
581b67ade3 net: add config to support allocate connect dynamically
add config CONFIG_NET_ALLOC_CONNS to support allocate connect.
Use this feature if the number of connections can not be determined at
compile time. When enabled the stack will be compiled without the static
pre-allocate connection list and all connection instances will be dynamically
allocated from heap at run time.

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-01 20:40:02 +08:00
Alexander Lunev
2b60468845 net/tcp(unbuffered): removed excessive overwrites of conn->sndseq
(conn->sndseq was updated in multiple places that was unreasonable and complicated).
2021-12-29 05:35:23 -06:00
Norman Rasmussen
48311cc61f Fix unaligned memory access when creating ICMP Port Unreachable messages
commit 3b69d09c80 corrected the
unreachable handling for net/udp/icmp but introduced an unaligned store.
This splits the uint32_t data field into a two element uint16_t data
field to avoid the unaligned store.
2021-12-28 03:51:53 -06:00
Petro Karashchenko
3ccb657dc2 nuttx: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 21:01:19 -06:00