Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos M
提交
9d3d9833
K
Kernel Liteos M
项目概览
OpenHarmony
/
Kernel Liteos M
大约 1 年 前同步成功
通知
20
Star
28
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos M
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9d3d9833
编写于
3月 22, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
!650 fix:告警修复
Merge pull request !650 from Zhaotianyu/0322codex_fix_1
上级
b0393151
0e2dded3
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
9 addition
and
7 deletion
+9
-7
components/net/lwip-2.1/porting/src/api_shell.c
components/net/lwip-2.1/porting/src/api_shell.c
+9
-7
未找到文件。
components/net/lwip-2.1/porting/src/api_shell.c
浏览文件 @
9d3d9833
...
...
@@ -282,7 +282,7 @@ LWIP_STATIC unsigned int get_hostip(const char *hname)
free
(
tmphstbuf
);
return
0
;
}
ret
=
memcpy_s
(
&
ip
,
sizeof
(
ip
),
pent
->
h_addr
,
4
);
ret
=
memcpy_s
(
&
ip
,
sizeof
(
ip
),
pent
->
h_addr
,
sizeof
(
pent
->
h_addr
)
);
if
(
ret
!=
EOK
)
{
free
(
tmphstbuf
);
return
0
;
...
...
@@ -410,7 +410,7 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
/* Accessing ip header and icmp header */
iphdr_resp
=
pbuf_resp
->
payload
;
ip_hlen
=
(
IPH_HL
(
iphdr_resp
)
<<
2
);
ip_hlen
=
(
IPH_HL
(
iphdr_resp
)
<<
2
);
/* 2: offset */
if
(
pbuf_header
(
pbuf_resp
,
-
ip_hlen
))
{
/* this failure will never happen, but failure handle is written just to be in safe side */
PRINTK
(
"Ping : memory management failure
\n
"
);
...
...
@@ -428,7 +428,8 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
((
ICMPH_TYPE
(
iecho_resp
)
==
ICMP_ECHO
)
&&
(
iphdr_resp
->
src
.
addr
==
to
.
sin_addr
.
s_addr
)))
{
/* second type timeout event */
(
void
)
clock_gettime
(
CLOCK_MONOTONIC_RAW
,
&
end
);
timout_ms
=
((
end
.
tv_sec
-
start
.
tv_sec
)
*
1000
+
(
end
.
tv_nsec
-
start
.
tv_nsec
)
/
1000000
);
timout_ms
=
((
end
.
tv_sec
-
start
.
tv_sec
)
*
OS_SYS_MS_PER_SECOND
+
\
(
end
.
tv_nsec
-
start
.
tv_nsec
)
/
OS_SYS_NS_PER_MS
);
timout_ms
=
LWIP_SHELL_CMD_PING_TIMEOUT
-
timout_ms
;
}
else
{
timout_ms
=
0
;
...
...
@@ -445,7 +446,8 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
}
/* capture the end time to calculate round trip time */
(
void
)
clock_gettime
(
CLOCK_MONOTONIC_RAW
,
&
end
);
rtt
=
((
end
.
tv_sec
-
start
.
tv_sec
)
*
1000
+
(
end
.
tv_nsec
-
start
.
tv_nsec
)
/
1000000
);
rtt
=
((
end
.
tv_sec
-
start
.
tv_sec
)
*
OS_SYS_MS_PER_SECOND
+
\
(
end
.
tv_nsec
-
start
.
tv_nsec
)
/
OS_SYS_NS_PER_MS
);
if
(
iphdr_resp
->
src
.
addr
==
to
.
sin_addr
.
s_addr
)
{
switch
(
ICMPH_TYPE
(
iecho_resp
))
{
...
...
@@ -461,12 +463,12 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
/* delay 1s for every successful ping */
intrvl
=
interval
;
do
{
if
(
intrvl
<
1000
)
{
if
(
intrvl
<
1000
)
{
/* 1000: 1000ms = 1s */
sys_msleep
(
intrvl
);
break
;
}
intrvl
-=
1000
;
sys_msleep
(
1000
);
intrvl
-=
1000
;
/* 1000: 1000ms = 1s */
sys_msleep
(
1000
);
/* 1000: 1000ms = 1s */
if
(
ping_kill
==
1
)
break
;
}
while
(
intrvl
>
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录