Commit Graph

2871 Commits

Author SHA1 Message Date
zhanghongyu
32b1af3008 tcp_send_buffered: change Not connected message level from error to warning
Non-blocking sockets are almost never in the connected state when app try to
get result of connect success through poll, to avoid confusion because of
this error print, so downgrade the print level to warning.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-25 20:38:59 +03:00
wangchen
99ee94728a net:add IP_MULTICAST_IF & IPV6_MULTICAST_IF function implementation
refer to https://man7.org/linux/man-pages/man7/ip.7.html
IP_MULTICAST_IF (since Linux 1.2)
              Set the local device for a multicast socket.  The argument
              for setsockopt(2) is an ip_mreqn or (since Linux 3.5)
              ip_mreq structure similar to IP_ADD_MEMBERSHIP, or an
              in_addr structure.  (The kernel determines which structure
              is being passed based on the size passed in optlen.)  For
              getsockopt(2), the argument is an in_addr structure.
refer to https://man7.org/linux/man-pages/man7/ipv6.7.html
IPV6_MULTICAST_IF
              Set the device for outgoing multicast packets on the
              socket.  This is allowed only for SOCK_DGRAM and SOCK_RAW
              socket.  The argument is a pointer to an interface index
              (see netdevice(7)) in an integer.
testcase1:
TEST_IMPL(udp_multicast_interface) {
/* TODO(gengjiawen): Fix test on QEMU. */
  RETURN_SKIP("Test does not currently work in QEMU");

  int r;
  uv_udp_send_t req;
  uv_buf_t buf;
  struct sockaddr_in addr;
  struct sockaddr_in baddr;

  close_cb_called = 0;
  sv_send_cb_called = 0;
  ASSERT(0 == uv_ip4_addr("239.255.0.1", TEST_PORT, &addr));

  r = uv_udp_init(uv_default_loop(), &server);
  ASSERT(r == 0);

  ASSERT(0 == uv_ip4_addr("0.0.0.0", 0, &baddr));
  r = uv_udp_bind(&server, (const struct sockaddr*)&baddr, 0);
  ASSERT(r == 0);

  r = uv_udp_set_multicast_interface(&server, "0.0.0.0");
  ASSERT(r == 0);

  /* server sends "PING" */
  buf = uv_buf_init("PING", 4);
  r = uv_udp_send(&req,
                  &server,
                  &buf,
                  1,
                  (const struct sockaddr*)&addr,
                  sv_send_cb);
  ASSERT(r == 0);

  ASSERT(close_cb_called == 0);
  ASSERT(sv_send_cb_called == 0);

  /* run the loop till all events are processed */
  uv_run(uv_default_loop(), UV_RUN_DEFAULT);

  ASSERT(sv_send_cb_called == 1);
  ASSERT(close_cb_called == 1);

  ASSERT(client.send_queue_size == 0);
  ASSERT(server.send_queue_size == 0);

  MAKE_VALGRIND_HAPPY();
  return 0;
}
testcase2:
TEST_IMPL(udp_multicast_interface6) {
/* TODO(gengjiawen): Fix test on QEMU. */
  RETURN_SKIP("Test does not currently work in QEMU");

  int r;
  uv_udp_send_t req;
  uv_buf_t buf;
  struct sockaddr_in6 addr;
  struct sockaddr_in6 baddr;

  if (!can_ipv6())
    RETURN_SKIP("IPv6 not supported");

  close_cb_called = 0;
  sv_send_cb_called = 0;

  ASSERT(0 == uv_ip6_addr("::1", TEST_PORT, &addr));

  r = uv_udp_init(uv_default_loop(), &server);
  ASSERT(r == 0);

  ASSERT(0 == uv_ip6_addr("::", 0, &baddr));
  r = uv_udp_bind(&server, (const struct sockaddr*)&baddr, 0);
  ASSERT(r == 0);

  r = uv_udp_set_multicast_interface(&server, "::1%lo0");
  r = uv_udp_set_multicast_interface(&server, NULL);
  ASSERT(r == 0);

  /* server sends "PING" */
  buf = uv_buf_init("PING", 4);
  r = uv_udp_send(&req,
                  &server,
                  &buf,
                  1,
                  (const struct sockaddr*)&addr,
                  sv_send_cb);
  ASSERT(r == 0);

  ASSERT(close_cb_called == 0);
  ASSERT(sv_send_cb_called == 0);

  /* run the loop till all events are processed */
  uv_run(uv_default_loop(), UV_RUN_DEFAULT);

  ASSERT(sv_send_cb_called == 1);
  ASSERT(close_cb_called == 1);

  MAKE_VALGRIND_HAPPY();
  return 0;
}

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-25 17:16:50 +08:00
Ville Juven
9cd8ea32d1 net/xx/wrbuffer: Do not use SEM_INITIALIZER for buffers
Using the macro places the buffers into .data section which means they
will consume the full buffer size of flash / read only memory as well.

Place the buffers into .bss to avoid this case.
2023-08-25 00:02:07 +08:00
Ville Juven
e163c74b90 rpmsg/rpmsg_sockif.c: Fix printf format for u64 type
Use PRIx64 which defines the width correctly regardless or architecture.

Fixes build error:
rpmsg/rpmsg_sockif.c:610:57: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
  610 |       snprintf(conn->nameid, sizeof(conn->nameid), ":%llx", g_rpmsg_id++);
      |                                                      ~~~^   ~~~~~~~~~~~~
      |                                                         |             |
      |                                                         |             uint64_t {aka long unsigned int}
      |                                                         long long unsigned int
      |                                                      %lx
2023-08-23 23:36:15 +08:00
Zhe Weng
d44e19d115 mm/iob: Add support for increasing length in iob_update_pktlen
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-22 16:34:21 +09:00
Zhe Weng
efc75de61e net/udp: Fix hybrid dual-stack IPv6/IPv4 socket
- Fix `ip6_map_ipv4addr` and `ip6_get_ipv4addr` macro to work under
  different endianness.
- Use `iob_reserve` instead of `iob_trimhead` in `udp_datahandler`.
  - Because we may set `sockaddr_in6` into IPv4 header, which causes
    `offset` become negative. `iob_reserve` can hold this case while
    `iob_trimhead` cannot.
- Select IPv4 domain in send case.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-22 09:09:21 +08:00
liqinhui
0100e8338e net: Fix unreadable error when doing poll operation on tcp socket.
When do poll operation and the tcp connection state is TCP_ALLOCATED, eventset(POLLERR|POLLHUP) is return, causing the libuv poll_multiple_handles to fail.

Verification: Use the libuv test case ` uv_run_tests poll_multiple_handles`.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-08-21 17:38:00 +08:00
xucheng5
9d3abe8b71 socket can : support ioctl cmd SIOCCANRECOVERY
send CMD to restart controller in state bus-off

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-21 13:18:51 +08:00
xucheng5
e8a2df4f80 devif/devif_poll : d_len must positive before invoke callback
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-21 13:04:15 +08:00
wangyingdong
2ce31c442f net/tcp:Added tcp zero window probe timer support
https://www.rfc-editor.org/rfc/rfc1122#page-92

Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-08-20 19:47:11 -03:00
wangyingdong
adf9e685ab Fix the bug that localsocket fails to send in CONFIG_NET_LOCAL_DGRAM mode because fs adds pipe check (commit 9e06c3e)
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-08-20 19:18:18 +03:00
zhanghongyu
5b35c4e5b0 local_recvmsg: do not print error message when errno is EAGAIN
Some programs use EAGAIN to determine whether all data has been read,
so cancel the error print when the error code is EAGAIN.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-20 20:19:35 +08:00
Xiang Xiao
90f8315432 arch: Remove up_netinitialize
since this api change to xxx_netinitialize

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-20 14:33:17 +03:00
zhanghongyu
1890ec5129 arp_wait: print dest ip address when receive wait timeout
If the arp query times out, the destination ip address is displayed to
help locate the problem

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-20 15:44:02 +08:00
Petro Karashchenko
075738cf14 net/ip: print ip addresses using ip4_addrN macro
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-19 13:28:21 -03:00
zhanghongyu
3bd495c09d icmp: add SOCK_RAW type support
Since ICMPv6 has added SOCK_RAW, a SOCK_RAW related implementation has also
been added for ICMP.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-19 22:04:22 +08:00
zhanghongyu
26c9f47ecc ipv6_setsockopt: remove redundant logic
Synchronize code differences from internal repositories to the community

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-18 16:47:56 -03:00
xucheng5
bcfb4decb0 socketcan : fixed CAN ID cast error
args can_id for recv_filter doesn't work properly

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-19 01:31:34 +08:00
Bowen Wang
5bc32727b4 rpmsg_sockif: block poll shoud not set POLLERR
Support poll rpmsg socket fd with block mode

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-08-19 01:30:18 +08:00
wangyingdong
8f6f601ec1 net/local:Add peek support for pipe and MSG_PEEK support for local socket
fifo peek example:
struct pipe_peek_s peek_buf;
peek_buf.len = len;
peek_buf.data = buf;
ret = file_ioctl(filep, PIPEIOC_PEEK,(unsigned long)((uintptr_t)&peek_buf));

Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-08-15 23:58:45 +08:00
Zhe Weng
d3bca3c2cf net: Add FIOC_FILEPATH ioctl support for ICMP(v6)/RPMsg/Usrsock sockets
Example of /proc/PID/group/fd in this case:

FD  OFLAGS  TYPE POS       PATH
3   3       9    0         icmp:[dev eth0, id 1, flg 1]
4   3       9    0         icmp6:[dev eth0, id 2, flg 1]
5   3       9    0         rpmsg:[ap:[test:0]<->remote] # server side
5   3       9    0         rpmsg:[remote<->ap:[test:0]] # client side

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-15 15:00:59 +08:00
Zhe Weng
8e8d86a7bb net/ioctl: Add default print for sockets without FIOC_FILEPATH support
Example of /proc/PID/group/fd in this case:

FD  OFLAGS  TYPE POS       PATH
17  67      9    0         socket:[domain 16, type 2, proto 0]

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-15 15:00:59 +08:00
liqinhui
719191ac72 net/local: Return an error when write the too big packet.
Verification:
  Write a packet, the length is bigger than CONFIG_DEV_FIFO_SIZE.
  The return value should be -1, and the errno is EMSGSIZE.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-08-14 23:46:08 +08:00
liqinhui
2d0df3b5f2 net/local: Fix the error return length when read the bigger packet.
Verifiction:
  Write a bigger packet and read the packet using a smaller buffer.
  The return length of reading should be the length of smaller buffer.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-08-14 21:11:30 +08:00
liqinhui
8631e0c6b5 net/tcp: Fix the sack byte aligment error.
The error log is as follows:
  tcp/tcp_send_buffered.c:376:57: runtime error: member access within misaligned
  address 0x10075942 for type 'struct tcp_sack_s', which requires 4 byte alignment

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-08-14 20:46:09 +08:00
Zhe Weng
d98bfc3e49 net/icmpv6: Fix icmpv6_neighbor for link-local address
The netdev of link-local address cannot be auto decided, and the link-local address should always be reguarded as address on local network.

The problem we met:
When using `icmpv6_autoconfig` with multiple netdev, the `icmpv6_neighbor` may take out wrong netdev with ip address already set, then it may send solicitation with wrong address (`dev->d_ipv6draddr`) on wrong device, and regard the link-local address as conflict (because `dev->d_ipv6draddr` exists on this network).

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-11 02:00:39 +08:00
hujun5
34dcd1c50a net: remove [enter|leave]_critical_section and sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-10 12:24:30 +03:00
Zhe Weng
c2ba0dfd6c net/netdev: Simplify handling of SIOCSIFMTU
The call of netdev_ifr_dev is already simplified by commit fd53db56b6

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-09 18:29:26 +08:00
Petro Karashchenko
1b0baa8337 nuttx: use lib_free for memory de-allocation after strdup or asprintf
The memory allocated with strdup and asprintf is done via lib_malloc
so we need to use lib_free to deallocate memory otherwise the assertion
"Free memory from the wrong heap" is hit with flat mode and user separated
heap enabled mode.

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-08 11:58:29 -03:00
zhangyuan21
114d641f4a net: add poll lock for local socket poll
net_lock/unlock is a big lock and repleace it to internal pool lock
to avoid the priority inversion problem.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-08-08 08:43:18 +02:00
Zhe Weng
817a43de4d net: Add FIOC_FILEPATH ioctl support for tcp/udp/local sockets
Example of /proc/PID/group/fd, which prints the file path:

FD  OFLAGS  TYPE POS       PATH
0   3       1    0         /dev/console
1   3       1    0         /dev/console
2   3       1    0         /dev/console
3   3       9    0         udp:[0.0.0.0:10197<->114.118.7.163:123, tx 0/16384, rx 0/16384, flg 1]
4   1027    9    0         tcp:[0.0.0.0:23<->0.0.0.0:0, tx 0/16384, rx 0/16384 + ofo 0, st 01, flg 31]
5   67      9    0         local:[md:ap]

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-07 08:08:37 -07:00
Zhe Weng
194d0cdec9 net/procfs: Simplify logic for tcp/udp stats
By:
1. Take out net_ip_binding_laddr/raddr macro
2. INET6_ADDRSTRLEN is long enough for all address buffer and no need to
   add 0 to the end of buffer since inet_ntop will do so

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-07 08:08:37 -07:00
ligd
0383377d78 rpmsg_socket: rpmsg_socket_ns_bound() with lock
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 08:01:31 -07:00
ligd
17010ff811 rpmsg_socket: move nameid outof user define space
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 08:01:31 -07:00
wangchen
5c798dd297 inet/inet_sockif.c:In tcp protocol, Add random ports during the listening phase, if no ports are bound
In tcp protocol, if no ports are bound, Add random ports during the listening phase

libuvtestcase:
TEST_IMPL(tcp_listen_without_bind) {
int r;
uv_tcp_t server;

r = uv_tcp_init(uv_default_loop(), &server);
ASSERT(r == 0);
r = uv_listen((uv_stream_t*)&server, 128, NULL);
ASSERT(r == 0);

MAKE_VALGRIND_HAPPY();
return 0;
}

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-03 03:24:23 -07:00
wangchen
d528d2c410 net/local/local_sockif.c:add local_getpeername function implementation
this testcast
TEST_IMPL(udp_send_unix) {
  /* Test that "uv_udp_send()" supports sending over
     a "sockaddr_un" address. */
  struct sockaddr_un addr;
  uv_udp_t handle;
  uv_udp_send_t req;
  uv_loop_t* loop;
  uv_buf_t buf = uv_buf_init("PING", 4);
  int fd;
  int r;

  loop = uv_default_loop();

  memset(&addr, 0, sizeof addr);
  addr.sun_family = AF_UNIX;
  ASSERT(strlen(TEST_PIPENAME) < sizeof(addr.sun_path));
  memcpy(addr.sun_path, TEST_PIPENAME, strlen(TEST_PIPENAME));

  fd = socket(AF_UNIX, SOCK_STREAM, 0);
  ASSERT(fd >= 0);

  unlink(TEST_PIPENAME);
  ASSERT(0 == bind(fd, (const struct sockaddr*)&addr, sizeof addr));
  ASSERT(0 == listen(fd, 1));

  r = uv_udp_init(loop, &handle);
  ASSERT(r == 0);
  r = uv_udp_open(&handle, fd);
  ASSERT(r == 0);
  uv_run(loop, UV_RUN_DEFAULT);

  r = uv_udp_send(&req,
                  &handle,
                  &buf,
                  1,
                  (const struct sockaddr*) &addr,
                  NULL);
  ASSERT(r == 0);

  uv_close((uv_handle_t*)&handle, NULL);
  uv_run(loop, UV_RUN_DEFAULT);
  close(fd);
  unlink(TEST_PIPENAME);

  MAKE_VALGRIND_HAPPY();
  return 0;
}

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-03 03:23:17 -07:00
wangchen
b10d6be17a net:Add check for address binding
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-03 03:16:31 -07:00
wangchen
14202651b2 net:Resolve udp disconnection, status not synchronized error
libuvtestcase:
TEST_IMPL(udp_connect) {
  RETURN_SKIP(
      "IBMi PASE's UDP connection can not be disconnected with AF_UNSPEC.");
  uv_udp_send_t req;
  struct sockaddr_in ext_addr;
  struct sockaddr_in tmp_addr;
  int r;
  int addrlen;

  close_cb_called = 0;
  cl_send_cb_called = 0;
  sv_recv_cb_called = 0;

  ASSERT(0 == uv_ip4_addr("[0.0.0.0](http://0.0.0.0/)", TEST_PORT, &lo_addr));

  r = uv_udp_init(uv_default_loop(), &server);
  ASSERT(r == 0);

  r = uv_udp_bind(&server, (const struct sockaddr*) &lo_addr, 0);
  ASSERT(r == 0);

  r = uv_udp_recv_start(&server, alloc_cb, sv_recv_cb);
  ASSERT(r == 0);

  r = uv_udp_init(uv_default_loop(), &client);
  ASSERT(r == 0);

  buf = uv_buf_init("EXIT", 4);

  /* connect() to INADDR_ANY fails on Windows wih WSAEADDRNOTAVAIL */
  ASSERT_EQ(0, uv_ip4_addr("[0.0.0.0](http://0.0.0.0/)", TEST_PORT, &tmp_addr));
  r = uv_udp_connect(&client, (const struct sockaddr*) &tmp_addr);
  ASSERT_EQ(r, UV_EADDRNOTAVAIL);
  ASSERT_EQ(r, 0);
  r = uv_udp_connect(&client, NULL);
  ASSERT_EQ(r, 0);

  ASSERT(0 == uv_ip4_addr("[8.8.8.8](http://8.8.8.8/)", TEST_PORT, &ext_addr));
  ASSERT(0 == uv_ip4_addr("[127.0.0.1](http://127.0.0.1/)", TEST_PORT, &lo_addr));

  r = uv_udp_connect(&client, (const struct sockaddr*) &lo_addr);
  ASSERT(r == 0);
  r = uv_udp_connect(&client, (const struct sockaddr*) &ext_addr);
  ASSERT(r == UV_EISCONN);

  addrlen = sizeof(tmp_addr);
  r = uv_udp_getpeername(&client, (struct sockaddr*) &tmp_addr, &addrlen);
  ASSERT(r == 0);

  /* To send messages in connected UDP sockets addr must be NULL */
  r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &lo_addr);
  ASSERT(r == UV_EISCONN);
  r = uv_udp_try_send(&client, &buf, 1, NULL);
  ASSERT(r == 4);
  r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &ext_addr);
  ASSERT(r == UV_EISCONN);

  r = uv_udp_connect(&client, NULL);
  ASSERT(r == 0);
  r = uv_udp_connect(&client, NULL);
  ASSERT(r == UV_ENOTCONN);

  addrlen = sizeof(tmp_addr);
  r = uv_udp_getpeername(&client, (struct sockaddr*) &tmp_addr, &addrlen);
  ASSERT(r == UV_ENOTCONN);

  /* To send messages in disconnected UDP sockets addr must be set */
  r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &lo_addr);
  ASSERT(r == 4);
  r = uv_udp_try_send(&client, &buf, 1, NULL);
  ASSERT(r == UV_EDESTADDRREQ);

  r = uv_udp_connect(&client, (const struct sockaddr*) &lo_addr);
  ASSERT(r == 0);
  r = uv_udp_send(&req,
                  &client,
                  &buf,
                  1,
                  (const struct sockaddr*) &lo_addr,
                  cl_send_cb);
  ASSERT(r == UV_EISCONN);
  r = uv_udp_send(&req, &client, &buf, 1, NULL, cl_send_cb);
  ASSERT(r == 0);

  uv_run(uv_default_loop(), UV_RUN_DEFAULT);

  ASSERT(close_cb_called == 2);
  ASSERT(sv_recv_cb_called == 4);
  ASSERT(cl_send_cb_called == 2);

  ASSERT(client.send_queue_size == 0);
  ASSERT(server.send_queue_size == 0);

  MAKE_VALGRIND_HAPPY();
  return 0;
}

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-03 03:12:17 -07:00
wangchen
842b6b88d3 net/udp:add check of the ip packet length
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-03 00:15:28 -07:00
wangchen
44442a655e inet/ipv4_setsockopt.c:fix libuv udp option error
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-02 22:54:13 -07:00
wangchen
bdf82d2087 net/tcp: Return -EINVAL if bind is called more than once
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-02 22:48:07 -07:00
wangyingdong
032a456c83 net/local:Add support for MSG_DONTWAIT to SOCK_STREAM
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-08-01 22:55:40 -07:00
Petro Karashchenko
6621dc016b net/udp: remove FAR from non-pointer variables
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:56:40 -07:00
dongjiuzhu1
44b08d3a67 net/rpmsg: read receiving data after unbind
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-29 07:04:43 -07:00
dongjiuzhu1
9a22741e32 net/rpmsg: get credentials between client and server
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 07:40:00 -07:00
wangyingdong
5ac8c71663 net/ipfrag:Fixed ref not initializing warning issue
CC: libssh/src/auth.c
1ipfrag/ipv4_frag.c: In function 'ipv4_fragout':
ipfrag/ipv4_frag.c:224:7: error: 'ref' may be used uninitialized in this function [-Werror-maybe-uninitialized]
      224 |      lmemcpy(ipv4, ref, iphdrlen);
ipfrag/ipv4_frag.c:364:26: note: 'ref' was declared here
      364 |   FAR struct ipv4_hdr_s *ref;
CC: tls/task initinfo c

Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-07-26 08:36:04 -03:00
chao an
49dec5b48c cmake/build: fix build break on cmake
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-25 15:00:10 +02:00
Zhe Weng
9fd26195d1 net/setsockopt: Add IP_TTL support
We have IPV6_UNICAST_HOPS and IPV6_MULTICAST_HOPS in ipv6_setsockopt,
but only IP_MULTICAST_TTL in ipv4_setsockopt. So add IP_TTL support.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-07-24 09:46:37 -07:00
wangchen
bde91a2abd inet:fix libuvtest udp multicast error
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-07-24 09:46:37 -07:00
chao an
9004a49431 net/local: forward threshold ioctl() to pipe
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-22 11:39:28 +08:00