Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
16b1aeb7
Unverified
Commit
16b1aeb7
authored
May 30, 2024
by
Mathieu Carbou
Committed by
GitHub
May 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(net): Fix IPv4 address construction from ip_addr_t and comparison (#9724) (#9725)
parent
f1cb6b83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
cores/esp32/IPAddress.cpp
cores/esp32/IPAddress.cpp
+2
-1
No files found.
cores/esp32/IPAddress.cpp
View file @
16b1aeb7
...
@@ -266,7 +266,7 @@ IPAddress &IPAddress::operator=(const IPAddress &address) {
...
@@ -266,7 +266,7 @@ IPAddress &IPAddress::operator=(const IPAddress &address) {
}
}
bool
IPAddress
::
operator
==
(
const
IPAddress
&
addr
)
const
{
bool
IPAddress
::
operator
==
(
const
IPAddress
&
addr
)
const
{
return
(
addr
.
_type
==
_type
)
&&
(
memcmp
(
addr
.
_address
.
bytes
,
_address
.
bytes
,
sizeof
(
_address
.
bytes
))
==
0
);
return
(
addr
.
_type
==
_type
)
&&
(
_type
==
IPType
::
IPv4
?
addr
.
_address
.
dword
[
IPADDRESS_V4_DWORD_INDEX
]
==
_address
.
dword
[
IPADDRESS_V4_DWORD_INDEX
]
:
memcmp
(
addr
.
_address
.
bytes
,
_address
.
bytes
,
sizeof
(
_address
.
bytes
))
==
0
);
}
}
bool
IPAddress
::
operator
==
(
const
uint8_t
*
addr
)
const
{
bool
IPAddress
::
operator
==
(
const
uint8_t
*
addr
)
const
{
...
@@ -395,6 +395,7 @@ IPAddress &IPAddress::from_ip_addr_t(const ip_addr_t *addr) {
...
@@ -395,6 +395,7 @@ IPAddress &IPAddress::from_ip_addr_t(const ip_addr_t *addr) {
#endif
/* LWIP_IPV6_SCOPES */
#endif
/* LWIP_IPV6_SCOPES */
}
else
{
}
else
{
_type
=
IPv4
;
_type
=
IPv4
;
memset
(
_address
.
bytes
,
0
,
sizeof
(
_address
.
bytes
));
_address
.
dword
[
IPADDRESS_V4_DWORD_INDEX
]
=
addr
->
u_addr
.
ip4
.
addr
;
_address
.
dword
[
IPADDRESS_V4_DWORD_INDEX
]
=
addr
->
u_addr
.
ip4
.
addr
;
}
}
return
*
this
;
return
*
this
;
...
...
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