Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
takeout_sbk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yunpeng.song
takeout_sbk
Commits
a277036a
Commit
a277036a
authored
Mar 20, 2024
by
wuyang.zou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug:
修正对 机器ip 地址的获取筛选条件
parent
18b38bbe
Pipeline
#43876
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
fmTakeout/SslOperate/MacTool.h
+7
-3
No files found.
fmTakeout/SslOperate/MacTool.h
View file @
a277036a
...
@@ -30,7 +30,8 @@ public:
...
@@ -30,7 +30,8 @@ public:
for
(
int
i
=
0
;
i
<
interfaces
.
length
();
i
++
)
{
for
(
int
i
=
0
;
i
<
interfaces
.
length
();
i
++
)
{
if
(
interfaces
[
i
].
isValid
()
)
{
if
(
interfaces
[
i
].
isValid
()
)
{
if
(
interfaces
[
i
].
flags
().
testFlag
(
QNetworkInterface
::
IsUp
)
&&
interfaces
[
i
].
flags
().
testFlag
(
QNetworkInterface
::
IsRunning
)
&&
if
(
interfaces
[
i
].
flags
().
testFlag
(
QNetworkInterface
::
IsUp
)
&&
interfaces
[
i
].
flags
().
testFlag
(
QNetworkInterface
::
IsRunning
)
&&
!
interfaces
[
i
].
flags
().
testFlag
(
QNetworkInterface
::
IsLoopBack
))
!
interfaces
[
i
].
flags
().
testFlag
(
QNetworkInterface
::
IsLoopBack
)
&&
interfaces
[
i
].
hardwareAddress
()
>
12
)
{
{
QLOG_INFO
()
<<
QString
(
"GetMacByAdaptersAddresses:: interfaces[ %1 ] = %2"
).
arg
(
i
+
1
).
arg
(
interfaces
[
i
].
hardwareAddress
()
);
QLOG_INFO
()
<<
QString
(
"GetMacByAdaptersAddresses:: interfaces[ %1 ] = %2"
).
arg
(
i
+
1
).
arg
(
interfaces
[
i
].
hardwareAddress
()
);
macAddressList
.
append
(
interfaces
[
i
].
hardwareAddress
()
);
macAddressList
.
append
(
interfaces
[
i
].
hardwareAddress
()
);
...
@@ -55,8 +56,11 @@ public:
...
@@ -55,8 +56,11 @@ public:
for
(
int
i
=
0
;
i
<
hostAddresses
.
length
();
i
++
)
{
for
(
int
i
=
0
;
i
<
hostAddresses
.
length
();
i
++
)
{
// if(address.protocol() == QAbstractSocket::IPv4Protocol) { } //1.1.1.1 > length > 7
// if(address.protocol() == QAbstractSocket::IPv4Protocol) { } //1.1.1.1 > length > 7
QHostAddress
hadr
=
hostAddresses
[
i
];
QHostAddress
hadr
=
hostAddresses
[
i
];
if
(
hadr
.
toString
().
length
()
>
7
&&
!
hadr
.
toString
().
contains
(
"127.0.0.1"
)
&&
!
hadr
.
toString
().
contains
(
"192.168."
)
QLOG_INFO
()
<<
QString
(
"GetMacByAdaptersAddresses:: hostAddresses: %1 "
).
arg
(
hadr
.
toString
()
);
&&
!
hadr
.
toString
().
contains
(
"10.0.75.1"
)
&&
!
hadr
.
toString
().
contains
(
"172."
)
&&
hadr
.
toString
().
contains
(
"10."
)
)
if
(
hadr
.
protocol
()
==
QAbstractSocket
::
IPv4Protocol
&&
hadr
.
toString
().
length
()
>
7
&&
!
hadr
.
toString
().
contains
(
"127.0.0.1"
)
&&
!
hadr
.
toString
().
startsWith
(
"192.168."
,
Qt
::
CaseInsensitive
)
// 新增限制
&&
!
hadr
.
toString
().
startsWith
(
"172."
,
Qt
::
CaseInsensitive
)
// 新增限制
)
{
{
QLOG_INFO
()
<<
QString
(
"GetMacByAdaptersAddresses:: hostAddresses[ %1 ] = %2 , protocol: %3"
)
QLOG_INFO
()
<<
QString
(
"GetMacByAdaptersAddresses:: hostAddresses[ %1 ] = %2 , protocol: %3"
)
.
arg
(
i
+
1
).
arg
(
hadr
.
toString
()
).
arg
(
hadr
.
protocol
()
);
.
arg
(
i
+
1
).
arg
(
hadr
.
toString
()
).
arg
(
hadr
.
protocol
()
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment