Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
adaa45ee
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
adaa45ee
编写于
3月 26, 2021
作者:
L
liuxianliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[fix] the overflow problem of lwip rx thread mailbox.
上级
a3b12cb7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
34 deletion
+34
-34
components/net/lwip-1.4.1/src/netif/ethernetif.c
components/net/lwip-1.4.1/src/netif/ethernetif.c
+5
-5
components/net/lwip-2.0.2/src/netif/ethernetif.c
components/net/lwip-2.0.2/src/netif/ethernetif.c
+3
-3
components/net/lwip-2.1.2/src/netif/ethernetif.c
components/net/lwip-2.1.2/src/netif/ethernetif.c
+26
-26
未找到文件。
components/net/lwip-1.4.1/src/netif/ethernetif.c
浏览文件 @
adaa45ee
...
...
@@ -156,16 +156,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_
static
int
lwip_netdev_set_dhcp
(
struct
netdev
*
netif
,
rt_bool_t
is_enabled
)
{
netdev_low_level_set_dhcp_status
(
netif
,
is_enabled
);
if
(
RT_TRUE
==
is_enabled
)
{
dhcp_start
((
struct
netif
*
)
netif
->
user_data
);
}
else
{
dhcp_stop
((
struct
netif
*
)
netif
->
user_data
);
dhcp_stop
((
struct
netif
*
)
netif
->
user_data
);
}
return
ERR_OK
;
}
#endif
/* RT_LWIP_DHCP */
...
...
@@ -648,7 +648,7 @@ static void eth_rx_thread_entry(void* parameter)
}
/* receive all of buffer */
while
(
1
)
do
{
if
(
device
->
eth_rx
==
RT_NULL
)
break
;
...
...
@@ -664,7 +664,7 @@ static void eth_rx_thread_entry(void* parameter)
}
}
else
break
;
}
}
while
(
rt_mb_recv
(
&
eth_rx_thread_mb
,
(
rt_ubase_t
*
)
&
device
,
RT_WAITING_NO
)
==
RT_EOK
);
}
else
{
...
...
components/net/lwip-2.0.2/src/netif/ethernetif.c
浏览文件 @
adaa45ee
...
...
@@ -173,7 +173,7 @@ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled)
}
else
{
dhcp_stop
((
struct
netif
*
)
netif
->
user_data
);
dhcp_stop
((
struct
netif
*
)
netif
->
user_data
);
}
return
ERR_OK
;
}
...
...
@@ -697,7 +697,7 @@ static void eth_rx_thread_entry(void* parameter)
}
/* receive all of buffer */
while
(
1
)
do
{
if
(
device
->
eth_rx
==
RT_NULL
)
break
;
...
...
@@ -713,7 +713,7 @@ static void eth_rx_thread_entry(void* parameter)
}
}
else
break
;
}
}
while
(
rt_mb_recv
(
&
eth_rx_thread_mb
,
(
rt_ubase_t
*
)
&
device
,
RT_WAITING_NO
)
==
RT_EOK
);
}
else
{
...
...
components/net/lwip-2.1.2/src/netif/ethernetif.c
浏览文件 @
adaa45ee
...
...
@@ -163,16 +163,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_
static
int
lwip_netdev_set_dhcp
(
struct
netdev
*
netif
,
rt_bool_t
is_enabled
)
{
netdev_low_level_set_dhcp_status
(
netif
,
is_enabled
);
if
(
RT_TRUE
==
is_enabled
)
{
dhcp_start
((
struct
netif
*
)
netif
->
user_data
);
}
else
{
dhcp_stop
((
struct
netif
*
)
netif
->
user_data
);
dhcp_stop
((
struct
netif
*
)
netif
->
user_data
);
}
return
ERR_OK
;
}
#endif
/* RT_LWIP_DHCP */
...
...
@@ -182,7 +182,7 @@ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled)
extern
int
lwip_ping_recv
(
int
s
,
int
*
ttl
);
extern
err_t
lwip_ping_send
(
int
s
,
ip_addr_t
*
addr
,
int
size
);
int
lwip_netdev_ping
(
struct
netdev
*
netif
,
const
char
*
host
,
size_t
data_len
,
int
lwip_netdev_ping
(
struct
netdev
*
netif
,
const
char
*
host
,
size_t
data_len
,
uint32_t
timeout
,
struct
netdev_ping_resp
*
ping_resp
)
{
int
s
,
ttl
,
recv_len
,
result
=
0
;
...
...
@@ -197,7 +197,7 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len,
struct
addrinfo
hint
,
*
res
=
RT_NULL
;
struct
sockaddr_in
*
h
=
RT_NULL
;
struct
in_addr
ina
;
RT_ASSERT
(
netif
);
RT_ASSERT
(
host
);
RT_ASSERT
(
ping_resp
);
...
...
@@ -216,7 +216,7 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len,
return
-
RT_ERROR
;
}
rt_memcpy
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
/* new a socket */
if
((
s
=
lwip_socket
(
AF_INET
,
SOCK_RAW
,
IP_PROTO_ICMP
))
<
0
)
{
...
...
@@ -284,7 +284,7 @@ const struct netdev_ops lwip_netdev_ops =
lwip_netdev_set_addr_info
,
#ifdef RT_LWIP_DNS
lwip_netdev_set_dns_server
,
#else
#else
NULL
,
#endif
/* RT_LWIP_DNS */
...
...
@@ -323,7 +323,7 @@ static int netdev_add(struct netif *lwip_netif)
{
return
-
ERR_IF
;
}
#ifdef SAL_USING_LWIP
extern
int
sal_lwip_netdev_set_pf_info
(
struct
netdev
*
netdev
);
/* set the lwIP network interface device protocol family information */
...
...
@@ -332,7 +332,7 @@ static int netdev_add(struct netif *lwip_netif)
rt_strncpy
(
name
,
lwip_netif
->
name
,
LWIP_NETIF_NAME_LEN
);
result
=
netdev_register
(
netdev
,
name
,
(
void
*
)
lwip_netif
);
/* Update netdev info after registered */
netdev
->
flags
=
lwip_netif
->
flags
;
netdev
->
mtu
=
lwip_netif
->
mtu
;
...
...
@@ -375,7 +375,7 @@ static int netdev_flags_sync(struct netif *lwip_netif)
{
return
-
ERR_IF
;
}
netdev
->
mtu
=
lwip_netif
->
mtu
;
netdev
->
flags
|=
lwip_netif
->
flags
;
...
...
@@ -438,7 +438,7 @@ static err_t eth_netif_device_init(struct netif *netif)
/* copy device flags to netif flags */
netif
->
flags
=
(
ethif
->
flags
&
0xff
);
netif
->
mtu
=
ETHERNET_MTU
;
/* set output */
netif
->
output
=
etharp_output
;
...
...
@@ -530,7 +530,7 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_
/* set linkoutput */
netif
->
linkoutput
=
ethernetif_linkoutput
;
/* get hardware MAC address */
rt_device_control
(
&
(
dev
->
parent
),
NIOCTL_GADDR
,
netif
->
hwaddr
);
...
...
@@ -550,7 +550,7 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_
ipaddr
.
addr
=
inet_addr
(
RT_LWIP_IPADDR
);
gw
.
addr
=
inet_addr
(
RT_LWIP_GWADDR
);
netmask
.
addr
=
inet_addr
(
RT_LWIP_MSKADDR
);
#else
#else
IP4_ADDR
(
&
ipaddr
,
0
,
0
,
0
,
0
);
IP4_ADDR
(
&
gw
,
0
,
0
,
0
,
0
);
IP4_ADDR
(
&
netmask
,
0
,
0
,
0
,
0
);
...
...
@@ -699,10 +699,10 @@ static void eth_rx_thread_entry(void* parameter)
}
/* receive all of buffer */
while
(
1
)
do
{
if
(
device
->
eth_rx
==
RT_NULL
)
break
;
p
=
device
->
eth_rx
(
&
(
device
->
parent
));
if
(
p
!=
RT_NULL
)
{
...
...
@@ -715,7 +715,7 @@ static void eth_rx_thread_entry(void* parameter)
}
}
else
break
;
}
}
while
(
rt_mb_recv
(
&
eth_rx_thread_mb
,
(
rt_ubase_t
*
)
&
device
,
RT_WAITING_NO
)
==
RT_EOK
);
}
else
{
...
...
@@ -725,9 +725,9 @@ static void eth_rx_thread_entry(void* parameter)
}
#endif
/* this function does not need,
* use eth_system_device_init_private()
* call by lwip_system_init().
/* this function does not need,
* use eth_system_device_init_private()
* call by lwip_system_init().
*/
int
eth_system_device_init
(
void
)
{
...
...
@@ -874,22 +874,22 @@ void list_if(void)
ip6_addr_t
*
addr
;
int
addr_state
;
int
i
;
addr
=
(
ip6_addr_t
*
)
&
netif
->
ip6_addr
[
0
];
addr_state
=
netif
->
ip6_addr_state
[
0
];
rt_kprintf
(
"
\n
ipv6 link-local: %s state:%02X %s
\n
"
,
ip6addr_ntoa
(
addr
),
rt_kprintf
(
"
\n
ipv6 link-local: %s state:%02X %s
\n
"
,
ip6addr_ntoa
(
addr
),
addr_state
,
ip6_addr_isvalid
(
addr_state
)
?
"VALID"
:
"INVALID"
);
for
(
i
=
1
;
i
<
LWIP_IPV6_NUM_ADDRESSES
;
i
++
)
{
addr
=
(
ip6_addr_t
*
)
&
netif
->
ip6_addr
[
i
];
addr_state
=
netif
->
ip6_addr_state
[
i
];
rt_kprintf
(
"ipv6[%d] address: %s state:%02X %s
\n
"
,
i
,
ip6addr_ntoa
(
addr
),
rt_kprintf
(
"ipv6[%d] address: %s state:%02X %s
\n
"
,
i
,
ip6addr_ntoa
(
addr
),
addr_state
,
ip6_addr_isvalid
(
addr_state
)
?
"VALID"
:
"INVALID"
);
}
}
rt_kprintf
(
"
\r\n
"
);
#endif
/* LWIP_IPV6 */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录