liqinhui
a60185cc40
net:Fix the warnings.
...
tcp/tcp_send_buffered.c: In function 'psock_send_eventhandler':
tcp/tcp_send_buffered.c:1025:17: warning: format '%u' expects argument of type 'unsigned int', but argument 9 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
1025 | ninfo("SEND: wrb=%p seq=%" PRIu32 " pktlen=%u sent=%u sndlen=%zu "
| ^~~~~~~~~~~~~~~~~~~~
......
1030 | conn->snd_wnd, seq, remaining_snd_wnd);
| ~~~~~~~~~~~~~
| |
| uint32_t {aka long unsigned int}
wireless/ieee80211/bcm43xxx/bcmf_netdev.c: In function 'bcmf_addmac':
wireless/ieee80211/bcm43xxx/bcmf_netdev.c:879:26: warning: unused variable 'priv' [-Wunused-variable]
879 | FAR struct bcmf_dev_s *priv = (FAR struct bcmf_dev_s *)dev->d_private;
| ^~~~
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:30:49 +08:00
liqinhui
bf78bf1db4
net/tcp: reset the dupack counter.
...
After setting the retransmission flag, we need to set the dupack counter to 0.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 02:12:55 +08:00
wangchen
ff7eda46e7
net_chksum.c:mod process of generating sum to solve checksum error
...
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-21 01:38:23 +08:00
wangchen
27c2940df2
netdev/ioctl: Setting log level to warning on SIOCGIFHWADDR failure
...
When our apps call getifaddrs on lo frequently, the loopback device will failed in SIOCGIFHWADDR and print too many error logs.
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-21 01:37:06 +08:00
liqinhui
590c7fe129
icmpv6: Allow IPv6 address obtained by both
...
stateless and stateful to coexist.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 01:33:28 +08:00
liqinhui
c00ff58baa
icmpv6: Set the default gateway for the stateful dhcpv6.
...
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 01:33:28 +08:00
wangchen
34fa02a652
icmp:add net_lock to protect icmp connection
...
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-20 11:21:08 -03:00
zhanghongyu
3c4897310b
tcp_input: if tcp->req > recvreq, send ack only when state is TCP_ESTABLISHED
...
The Bluetooth network on N62 does not retransmit packet, so no packet
retransmition if we drop one, we will drop packet when tcp_close_eventhandler
is register and invoke by tcp_input. then we will always early return and
never stop, the peer will only close the connection if we send reset packet.
precondition:
close -> register tcp_close_eventhandler;
tcp_input -> tcp_callback(TCP_NEWDATA) -> devif_conn_event -> tcp_close_eventhandler
-> flags &= ~TCP_NEWDATA -> NOT entry tcp_data_event -> conn->recvreq NOT increase
old flow:
tcp_input -> tcp->seqno greater than conn->rcvseq -> tcp_send(TCP_ACK)
with this patch:
tcp_input -> tcp->seqno greater than conn->rcvseq -> !TCP_ESTABLISHED
-> case TCP_FIN_WAIT_1 -> dev->d_len greater than 0 -> tcp_reset
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-20 08:31:55 +02:00
wangchen
5fedb1e6de
tcp_timer.c:solve Problem of parameter calculation exceeding the boundary
...
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-20 13:51:39 +08:00
nuttxs
e6962942cb
net/pkt: fix raw socket send data length is insufficient.
2024-08-20 13:41:49 +08:00
zhanghongyu
ce0599f46c
net/icmpv6/icmpv6_input.c: fix undefined build error
...
When CONFIG_NETDB_RESOLVCONF is enabled, CONFIG_NETDB_DNSSERVER_NAMESERVERS
will undefined, could cause net/icmpv6/icmpv6_input.c build error.
just add one nameserver to avoid overwrite ipv4 nameserver.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-19 19:50:44 +08:00
zhanghongyu
87ebdb850c
net/pkt: fix issue that set nonblock by fcntl does not take effect
...
pkt_sockcaps returns SOCKCAP_NONBLOCKING to indicate that pkt supports
nonblock configuration.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-19 16:45:15 +08:00
Shoukui Zhang
3f3ad34f42
Fix greater-than-or-equal-to-zero issue
...
unsigned_compare: This greater-than-or-equal-to-zero comparison without a signed value is always true. conn->lc_crefs >= 0
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-08-08 17:19:42 +08:00
zhanghongyu
3fa5466077
net/pkt: correct PF_PACKET family sending errors
...
Enable the pkt_sendmsg interface to send packets containing Layer 2
headers.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-07-14 13:20:14 -03:00
zhanghongyu
d0aa42c2ca
net/devif: devif_send supports negative offset
...
To enable the pkt_sendmsg interface to send packets containing L2 headers
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-07-14 13:20:14 -03:00
zhanghongyu
5e1c25b23c
net/netfilter: fix windows compile error
...
Resolve compilation errors encountered during compilation in windows
platform.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-07-14 20:33:18 +08:00
Alan Carvalho de Assis
82946d0d5f
net: Enable ICMP by default if IPv4 is enabled
...
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-07-09 17:08:27 +08:00
Kian Karas
46a8c665d7
net/tcp: fix missing error code propagation
...
If devif_send() failed its returned error code was not propagated
to user space. Instead, a send length of zero was returned (in
violation of POSIX).
2024-06-22 19:26:14 -03:00
Kian Karas
324446bbba
net/udp: fix net_[un]lock() in udp_bind
...
net_unlock() called without a previous call to net_lock().
Error introduced by b10d6be17a
2024-06-22 19:26:14 -03:00
Zhe Weng
2c303f213f
net/netfilter: Add filter table in ip6tables
...
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-20 09:43:05 +08:00
Zhe Weng
c72edb0637
net: Add set/getsockopt options compatible with ip6tables
...
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-20 09:43:05 +08:00
Zhe Weng
9637c10696
net/netfilter: Add filter table in iptables.
...
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-20 09:43:05 +08:00
Zhe Weng
f7181676b7
net: Support IP packet filter
...
Add a firewall compatible with Linux's iptables and ip6tables, with chains at similar points in the packet processing path.
NIC ─> ipv[46]_input ┬> ipv[46]_forward ─> [FORWARD] ┬> devif_poll_out ─> NIC
│ │
│ ┌> tcp ┐ │
│ ├> udp ┤ │
└> [INPUT] ┼> icmp ┼> [OUTPUT] ┘
├> icmp6 ┤
└> ... ┘
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-20 09:43:05 +08:00
gaohedong
dc651e090e
net/can: Add SO_RCVBUF option for can socket
...
If the CAN stack receiving packets fast, but the application layer reading packets slow. Then `conn->readahead` will continue to grow, leading to memory leaks. Finally CAN stack potentially starve out all IOB buffers. To prevent memory leaks, users can restrict can socket buffer length.
Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-06-14 19:54:07 +08:00
zhushiqi
d029e88472
nuttx/net: fixed bind can not return error when used same addr.
...
Signed-off-by: zhushiqi <hiccupzhu@gmail.com>
2024-06-13 22:00:41 +08:00
meijian
f4d9005bea
netlink: fix IPV6 macro bug
...
Signed-off-by: meijian <meijian@xiaomi.com>
2024-06-06 09:27:50 +02:00
Tiago Medicci Serrano
96f83bb03a
net: Enable CONFIG_NET_ARP_SEND
by default
...
Enable logic to send ARP requests if the target IP address mapping
does not appear in the ARP table.
Please check the comment in https://github.com/apache/nuttx/issues/12446#issuecomment-2145856778
2024-06-06 02:40:16 +08:00
zhanghongyu
9472426f69
net/inet: Rename ttl to s_ttl in sconn.
...
uniform naming convention
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-06-05 23:22:15 +08:00
liqinhui
05b101134a
net:Support jumbo frame prealloc the iob for the ICMP/UDP/TCP.
...
For the ICMP, UDP and TCP, pre-alloc an iob for a jumbo frame.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-06-02 09:31:37 -03:00
raiden00pl
c09f7f7864
cmake: add missing arp_acd.c file
2024-06-02 09:27:36 -03:00
raiden00pl
b01e8b1b6e
net/ipfrag/Kconfig: NET_IPFRAG depends on IOB_NCHAINS > 0
2024-06-02 09:27:36 -03:00
meijian
0bad215cf8
net/tcp: fix tcp will not close when tcp retransmission reaches TCP_MAXRTX
...
In "psock_send_eventhandler",when retransmit count bigger TCP_MAXRTX nuttx will set release wrb. But before this it will also set "conn->tx_unacked = 0" if we only retransmit one packet(conn->tx_unacked == sent),and In func "tcp_timer" only "conn->tx_unacked > 0" will close the tcp conn. So app will never close if nuttx retransmit over max timers.
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-22 17:46:04 -03:00
yinshengkai
20ebe0e64c
Replace all asserts in kernel code with ASSERT
...
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-05-17 10:18:16 -03:00
meijian
d199249769
[net][udp] fix udp wrb-iob leak when NIC was down
...
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-15 11:12:36 +08:00
meijian
11dfc5809a
[ipv6][netlink] add netlink report when get ipv6 address by icmpv6
...
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 16:00:45 -03:00
meijian
35f8c19112
[net][route] fix Mico definition bug
...
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 22:05:35 +08:00
meijian
4702a09538
net/netlink: Add RTM preifx notify support
...
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 10:05:37 -03:00
meijian
8eaefd2424
net/netlink: Add RTM neigh notify support
...
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 10:05:37 -03:00
meijian
34aeeb024c
net/netlink: Add RTM route support
...
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 10:05:37 -03:00
meijian
98d5e118c0
[icmpv6] fix resource leak of icmpv6
...
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 16:25:56 +08:00
simbit18
09bfaa7292
fix nxstyle
...
fix Relative file path does not match actual file.
2024-05-11 01:19:06 +08:00
zhanghongyu
45568229ef
tcp: decouple TCP_NODELAY and NET_TCP_KEEPALIVE
...
TCP_NODELAY is an independent configuration and does not depend on TCP_KEEPALIVE
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-29 17:45:14 +08:00
zhanghongyu
0cd893fb5a
icmpv6_neighbor: Simply skip IPv6 conflict detection on L3 Nic
...
Otherwise, the IP address is always considered to conflict, and the ipv6
address cannot be effectively obtained.
Later we will look at how to perform conflict detection on L3 network cards
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-29 17:44:40 +08:00
zhanghongyu
f739fd010d
icmpv6_neighbor: skip neighbor solicitation on L3 Nic
...
Otherwise, sending will fail because the neighbor table cannot be found
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-29 17:44:40 +08:00
Zhe Weng
41ab3a9cfe
net/udp_input: Only dup packets for broadcast / multicast.
...
We found previous multicast support (https://github.com/apache/nuttx/pull/12015 ) harms some unicast situation, and the `udp_input` should not dup packets for unicast.
Now, we only pass broadcast / multicast packets into each listener and let the code under control of `CONFIG_NET_BROADCAST`.
Ref: https://github.com/torvalds/linux/blob/v6.8/net/ipv4/udp.c#L2219
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-24 08:24:47 +02:00
Zhe Weng
3a844d8dd7
net/netlink: Add NETLINK_NETFILTER's CONNTRACK support
...
Now we only supports conntrack info from NAT entries, to let our apps in user space know the mapping status in NAT.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-18 13:03:59 +08:00
Zhe Weng
9b77bb16c9
net/netlink: Move netlink_add_terminator as public
...
Prepare for other netlink dumps.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-18 13:03:59 +08:00
Zhe Weng
b0cf0acc66
net/nat: Add foreach interface for entries
...
Prepare for netlink conntrack dump of entries.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-18 13:03:59 +08:00
Zhe Weng
932c41debb
net/nat: Remove unnecessary logic in inbound logic
...
Finish https://github.com/apache/nuttx/pull/12116#discussion_r1560880897
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-12 14:39:01 +02:00
Zhe Weng
17584eaa4f
net/nat: Rename struct ipv*_nat_entry
to ipv*_nat_entry_t
...
I found `struct ipv*_nat_entry` is missing `_s` suffix, but the name is too long in some cases, so maybe `ipv*_nat_entry_t` could be better.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-12 14:39:01 +02:00