Commit Graph

32 Commits

Author SHA1 Message Date
ligd 01676cb9cd local_socket: corrent send/recv return value after shutdown
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-12 09:57:20 +08:00
Shoukui Zhang 43223124ec vfs/file: add reference counting to prevent accidental close during reading writing...
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-17 12:01:53 +08:00
Alin Jerpelea 67d02a45eb net: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-09-12 01:08:11 +08:00
zhanghongyu cd86499e83 local_socket: add SO_SNDBUF & SO_RCVBUF support for accept socket
SO_SNDBUF takes effect only after the connection in STREAM mode
is successful
support full life cycle modification of SO_RCVBUF

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-09-10 11:35:15 +08:00
ligd 98c6cd45db local_socket: add SO_SNDBUF & SO_RCVBUF support
lets a user program modify the size of the local_socket buffer
using setsockopt.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-10 11:35:15 +08:00
Petro Karashchenko 1528b8dcca nuttx: resolve various 'FAR' and 'CODE' issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-26 10:21:03 +08:00
wangchen 2195270ed5 localsocket:add net_lock to protect connection
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-23 16:14:39 -03:00
wangchen eb0055fd4a local_sendto:move lc_sendlock position to protect file system interface
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-23 16:14:39 -03:00
wangchen 9147c955dc local:local socket sendto with adding binding path info
For udp localsocket current implementation,the sent information only carries the packet info.
The receiver receives the information,it don't know who the information comes from.
Thus the receiver doesn't know who to send the response message to.

We add sender's binding path info in the information,the receiver knows who sent the information
based on the parsed information.
The receiver knows who to send the response message to.

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-23 16:14:39 -03:00
wangchen f811b78d8c local:add check to the localsocket binding the path
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-23 16:14:39 -03:00
Xiang Xiao 155768bae3 net/local: Fix minor issues found in code reading
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-10 11:44:33 -03:00
Xiang Xiao 61d9394366 net/local: Add local_freectl to avoid the code duplicaton
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-29 16:28:01 -03:00
ligd 7ccdd29f3e local: correct shutdown state when use UDP mode
Signed-off-by: ligd <liguiding1@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2024-02-29 16:28:01 -03:00
Bowen Wang 7a9aa9539c local_sendmsg: fix peer->lc_cfps[] array out-of-range write
When peer->lc_cfpcount == LOCAL_NCONTROLFDS,
Line 122: peer->lc_cfps[peer->lc_cfpcount++] = filep2; access
out-of-range

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-01-04 20:07:06 -08:00
zhanghongyu d50b1778f7 net/local: make the call return of each process consistent with linux
move the accept logic into connect flow.

In order to successfully establish a blocking connection between
the client and server on the same thread.

nonblock is not affected, and the block connect is now the same
as the nonblock flow, other apis are not affected.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-12-25 16:53:46 -08:00
chao an 7d1763a57c net/assert: remove all unnecessary check for psock/conn
Since inet/socket layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 20:36:49 +08:00
chao an 664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
liqinhui a7a47621fa net/local: Support the socketpair interface of local udp socket.
Add the proccessing logic of udp socketpair, and modify the
logic of sending and receiving for udp socketpair.

Verification:
 - Use the socketpair interface to create a pair of local udp sockets,
   and perform read and write operations.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-07-12 03:31:43 +08:00
chao an 589d4a9f8e net/semantic/parser: fix compile warning found by sparse
Reference:
https://linux.die.net/man/1/sparse

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 23:00:00 +08:00
Xiang Xiao 8d56a9bbcb Remove #warning if the code already return the error code or value
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-18 15:44:28 +03:00
zhanghongyu 91e13c47ae net: remove conn-related casts
remove redundant casts associated with psock

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-10 19:32:09 -03:00
chao an 1cb11968b7 net/ip: fix compile break if enable NET_LOCAL_SCM
1.
net/slip.c:865:29: warning: unused variable ‘priv’ [-Wunused-variable]
  865 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
net/slip.c: In function ‘slip_rmmac’:
net/slip.c:895:29: warning: unused variable ‘priv’ [-Wunused-variable]
  895 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
2.
local/local_sendmsg.c: In function ‘local_sendmsg’:
local/local_sendmsg.c:423:18: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  423 |           return count;
      |                  ^~~~~
local/local_sendmsg.c:131:11: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  131 |   while (i-- > 0)
      |          ~^~
local/local_sendmsg.c:71:7: note: ‘i’ was declared here
   71 |   int i;
      |       ^

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 12:46:40 +02:00
anjiahao d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Xiang Xiao bdeaea3742 Remove the unnessary empty line after label
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-30 17:54:56 +02:00
田昕 20b9cc37d5 net/local:Make local send multi-thread safe
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-08-08 22:45:44 +08:00
chao.an 99cde13a11 net/inet: move socket flags into socket_conn_s
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-10 15:04:33 -03:00
chao.an 1b5d6aa068 net/local: add socket message control support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-24 08:09:28 -07:00
chao.an 1a55d933ef net/local: add nonblock connect(2) support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-19 19:18:52 -07:00
chao.an a48513ad65 local/stream: remove preamble header in stream mode
Preable sync header is no necessary in stream mode

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-07-21 23:43:10 -07:00
chao.an f8e800765c net/local: correct the sendto() return length
return length should be data length

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-04-19 11:52:17 -05: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
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