Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f7fc437f
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f7fc437f
编写于
1月 19, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1557 【kernel_lite】【master】修改NET模块里面的敏感信息
Merge pull request !1557 from limeng/cherry-pick-1642042548
上级
88a82c64
4f6609cf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
7 deletion
+5
-7
kernel_lite/net_posix/src/ActsNetTest.cpp
kernel_lite/net_posix/src/ActsNetTest.cpp
+5
-7
未找到文件。
kernel_lite/net_posix/src/ActsNetTest.cpp
浏览文件 @
f7fc437f
...
@@ -1072,8 +1072,7 @@ HWTEST_F(ActsNetTest, testIoctlIfconf, Function | MediumTest | Level2)
...
@@ -1072,8 +1072,7 @@ HWTEST_F(ActsNetTest, testIoctlIfconf, Function | MediumTest | Level2)
int
ifrCount
=
ifc
.
ifc_len
/
sizeof
(
struct
ifreq
);
int
ifrCount
=
ifc
.
ifc_len
/
sizeof
(
struct
ifreq
);
EXPECT_TRUE
(
ifrCount
>=
2
);
EXPECT_TRUE
(
ifrCount
>=
2
);
for
(
int
i
=
0
;
i
<
ifrCount
;
i
++
)
{
for
(
int
i
=
0
;
i
<
ifrCount
;
i
++
)
{
printf
(
"[###]interface name is %s, ip addr is %s
\n
"
,
ifr
[
i
].
ifr_name
,
printf
(
"[###]interface name is %s
\n
"
,
ifr
[
i
].
ifr_name
);
inet_ntoa
(((
struct
sockaddr_in
*
)
&
ifr
[
i
].
ifr_addr
)
->
sin_addr
));
}
}
ret
=
close
(
udpFd
);
ret
=
close
(
udpFd
);
EXPECT_EQ
(
0
,
ret
);
EXPECT_EQ
(
0
,
ret
);
...
@@ -1163,8 +1162,7 @@ HWTEST_F(ActsNetTest, testIoctlIfnetAddrOthers, Function | MediumTest | Level2)
...
@@ -1163,8 +1162,7 @@ HWTEST_F(ActsNetTest, testIoctlIfnetAddrOthers, Function | MediumTest | Level2)
ASSERT_EQ
(
0
,
ret
)
<<
"ioctl fail[SIOCGIFADDR], errinfo["
<<
strerror
(
errno
)
<<
"]"
;
ASSERT_EQ
(
0
,
ret
)
<<
"ioctl fail[SIOCGIFADDR], errinfo["
<<
strerror
(
errno
)
<<
"]"
;
addr2
=
(
struct
sockaddr_in
*
)
&
ifrTmp
.
ifr_addr
;
addr2
=
(
struct
sockaddr_in
*
)
&
ifrTmp
.
ifr_addr
;
EXPECT_EQ
(
addr1
->
sin_addr
.
s_addr
,
addr2
->
sin_addr
.
s_addr
);
EXPECT_EQ
(
addr1
->
sin_addr
.
s_addr
,
addr2
->
sin_addr
.
s_addr
);
printf
(
"[###]get %s addr1[%s],addr2[%s]
\n
"
,
ifr
[
i
].
ifr_name
,
inet_ntoa
(
addr1
->
sin_addr
),
printf
(
"[###]get %s
\n
"
,
ifr
[
i
].
ifr_name
);
inet_ntoa
(
addr2
->
sin_addr
));
// set inet addr
// set inet addr
addr2
->
sin_addr
.
s_addr
=
addr1
->
sin_addr
.
s_addr
;
addr2
->
sin_addr
.
s_addr
=
addr1
->
sin_addr
.
s_addr
;
...
@@ -1223,7 +1221,7 @@ HWTEST_F(ActsNetTest, testIoctlIfhwAddr, Function | MediumTest | Level2)
...
@@ -1223,7 +1221,7 @@ HWTEST_F(ActsNetTest, testIoctlIfhwAddr, Function | MediumTest | Level2)
ret
=
sprintf_s
(
rst1
,
sizeof
(
rst1
),
"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x"
,
*
macPtr
,
*
(
macPtr
+
1
),
ret
=
sprintf_s
(
rst1
,
sizeof
(
rst1
),
"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x"
,
*
macPtr
,
*
(
macPtr
+
1
),
*
(
macPtr
+
2
),
*
(
macPtr
+
3
),
*
(
macPtr
+
4
),
*
(
macPtr
+
5
));
*
(
macPtr
+
2
),
*
(
macPtr
+
3
),
*
(
macPtr
+
4
),
*
(
macPtr
+
5
));
EXPECT_EQ
(
strlen
(
rst1
),
(
unsigned
int
)
ret
)
<<
"sprintf_s error"
;
EXPECT_EQ
(
strlen
(
rst1
),
(
unsigned
int
)
ret
)
<<
"sprintf_s error"
;
printf
(
"[###]get %s
rst[%s]
\n
"
,
ifrTmp
.
ifr_name
,
rst1
);
printf
(
"[###]get %s
\n
"
,
ifrTmp
.
ifr_name
);
}
}
}
}
ret
=
close
(
udpFd
);
ret
=
close
(
udpFd
);
...
@@ -1745,7 +1743,7 @@ HWTEST_F(ActsNetTest, testInetPtonIpv4Normal, Function | MediumTest | Level2)
...
@@ -1745,7 +1743,7 @@ HWTEST_F(ActsNetTest, testInetPtonIpv4Normal, Function | MediumTest | Level2)
#else
#else
EXPECT_EQ
(
expectBig
[
i
],
rst
.
s_addr
);
EXPECT_EQ
(
expectBig
[
i
],
rst
.
s_addr
);
#endif
#endif
printf
(
"[###]inet_pton
%s: un[%u],s[%d],hex[%x]
\n
"
,
cpAddrs
[
i
]
,
rst
.
s_addr
,
rst
.
s_addr
,
rst
.
s_addr
);
printf
(
"[###]inet_pton
: un[%u],s[%d],hex[%x]
\n
"
,
rst
.
s_addr
,
rst
.
s_addr
,
rst
.
s_addr
);
}
}
}
}
...
@@ -1882,7 +1880,7 @@ HWTEST_F(ActsNetTest, testInetNtopIpv6Normal, Function | MediumTest | Level2)
...
@@ -1882,7 +1880,7 @@ HWTEST_F(ActsNetTest, testInetNtopIpv6Normal, Function | MediumTest | Level2)
char
inputAddrs
[
6
][
40
]
=
{
"0101:0101:0101:0101:1010:1010:1010:1010"
,
"0:0:0:0:0:0:0:0"
,
char
inputAddrs
[
6
][
40
]
=
{
"0101:0101:0101:0101:1010:1010:1010:1010"
,
"0:0:0:0:0:0:0:0"
,
"FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"
,
"::"
,
"1::"
,
"0011:0011:0011:0011:11:11:11:11"
};
"FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"
,
"::"
,
"1::"
,
"0011:0011:0011:0011:11:11:11:11"
};
char
expectAddrs
[
6
][
40
]
=
{
"101:101:101:101:1010:1010:1010:1010"
,
"::"
,
char
expectAddrs
[
6
][
40
]
=
{
"101:101:101:101:1010:1010:1010:1010"
,
"::"
,
"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
,
"::"
,
"1::"
,
"11:11:11:11:11:11:11:11"
};
"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
,
"::"
,
"1::"
,
"11:11:11:11:11:11:11:11"
};
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
iret
=
inet_pton
(
AF_INET6
,
inputAddrs
[
i
],
&
inputAddr
);
iret
=
inet_pton
(
AF_INET6
,
inputAddrs
[
i
],
&
inputAddr
);
ASSERT_EQ
(
1
,
iret
);
ASSERT_EQ
(
1
,
iret
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录