Skip to content

Rewrite IPAddress without union #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix comparison operator error
Begin index didn't be selected.
  • Loading branch information
safocl committed Nov 8, 2023
commit b44f1b121f90d9481d88124ef44e9e122d8b0efc
2 changes: 1 addition & 1 deletion api/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ bool IPAddress::operator==(const uint8_t* addr) const
{
// IPv4 only comparison to byte pointer
// Can't support IPv6 as we know our type, but not the length of the pointer
return _type == IPv4 && std::equal(_address.begin(), _address.end(), addr);
return _type == IPv4 && std::equal(_address.begin() + IPADDRESS_V4_BYTES_INDEX, _address.end(), addr);
}

uint8_t IPAddress::operator[](int index) const {
Expand Down