Intermediate files of make depend like .ddc and .dds may remain
when make is interrupted. Remove them using make distclean.
Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
Some compilers like Tasking do not support anonymous unions/structs.
Add explicit names to the anonymous union and struct members in
snoop_packet_header_s and update all references accordingly.
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
This reverts commit fa652f9c24.
When testing iperf on boards such as ESP32-C6, ESP32-C3, and ESP32,
blocking issues are encountered, so the patch is reverted.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
The main content of this submission is to limit both the TX/RX buffers
of TCP/UDP to throttled IOBs, avoiding impacts on the sending and
receiving of control-type messages.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
the lock in the "bluetooth_conn" was not initialized, which resulted in
a blocking situation when attempting to hold the lock for the first
time.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
In usrsock_pollsetup, only set POLLIN if USRSOCK_EVENT_RECVFROM_AVAIL is set when remote is closed, avoiding invalid POLLIN events.
Signed-off-by: daichuan <daichuan@xiaomi.com>
Clear USRSOCK_EVENT_RECVFROM_AVAIL flag when remote closes connection during accept to prevent repeated POLLIN events and EPIPE loop.
Signed-off-by: daichuan <daichuan@xiaomi.com>
Add CONFIG_NET_NO_LTO to allow compiling the network stack with -fno-lto.
This is useful for avoiding LTO-related issues in the network layer.
Signed-off-by: daichuan <daichuan@xiaomi.com>
When an unrecognized ICMP (type=3, code=2) packet is received, the ICMP flow does not set dev->d_len to 0, causing a devif_loopback dead loop.
Therefore, in ICMP input processing, when an ICMP_DEST_UNREACHABLE message is received, if it is not ICMP_FRAG_NEEDED code, jump to typeerr for error handling.
Signed-off-by: daichuan <daichuan@xiaomi.com>
For the LIN protocol, the error frame ID can be 0. This change is to ensure that all LIN error frames can pass the filter.
Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
Update the can_sendmsg() signature from "struct msghdr *msg" to
"const struct msghdr *msg" to match the updated sendmsg() prototype
and resolve compilation errors due to parameter type inconsistency.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
To ensure consistency, in all places where the "sendmsg" function is used
either directly or indirectly, the type of the "struct msghdr *msg" parameter
needs to be modified to "const struct msghdr *msg".
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Rename imr_interface to imr_address in struct ip_mreqn to match the Linux definition.
This ensures compatibility with standard socket APIs and existing Linux applications.
Signed-off-by: daichuan <daichuan@xiaomi.com>
expose the query interface of the network card to the network card
driver so that the network card driver can support more features.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
The RFC requires sending an TCP_RST packet in this scenario, so to better
comply with the standard definition, the sending of TCP_RST is added.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
urgent data needs to be treated as normal data when
CONFIG_NET_TCPURGDATA disable. some test sets will verify this
behavior, correct the processing logic.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This patch adds validation for IPv4 option lengths during packet processing
to prevent malformed packets from causing undefined behavior. The new
ipv4_check_opt() function verifies that option lengths are within valid
bounds before processing them.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This patch fixes the validation order in netdev ioctl handlers for
Bluetooth, IEEE 802.15.4, and packet radio devices. The command type
should be validated before checking the argument pointer to return
the correct error code (-ENOTTY vs -EINVAL).
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
d_len needs to include NET_LL_HDRLEN(dev) to avoid errors in
the verification of message length in ipv4_in/ipv6_in.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
During the autoconfig process, if the user modifies the link local
address while waiting for the Router Advertisement message, a crash will
occur when sending the ICMPv6 Neighbor Advertisement message because
netdev_ipv6_lladdr returns NULL.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
The can_datahandler() function calls iob_tryadd_queue() to enqueue
received CAN data. Since iob_tryadd_queue() may return a negative
value on failure, the error was previously not properly handled.
Update can_datahandler() to propagate the return value so callers
can detect and handle queueing failures correctly.
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
netdev:when network device is running status,the network protocol stack is allowed to send packet to the network device and to receive from the network device
Signed-off-by: wangchen <wangchen41@xiaomi.com>
optimize the current code format according to the previous net_xxx_wait
implementation to reduce multiple calls of similar code
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
the following code can be modified
conn_dev_unlock(&conn->sconn, conn->dev);
ret = net_sem_timedwait_uninterruptible(&conn->snd_sem,
tcp_send_gettimeout(start, timeout));
conn_dev_lock(&conn->sconn, conn->dev);
to
ret = conn_dev_sem_timedwait(&conn->snd_sem, false,
tcp_send_gettimeout(start, timeout), &conn->sconn, conn->dev);
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
modify functions that are simple but frequently called into inline
functions, thereby reducing CPU loading without significantly changing
the code size.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
reduce the execution consumption of irrelevant code
testing the TX rates of TCP and UDP based on the Infineon board can
increase them by 13%.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>