mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-30 19:15:08 +01:00
Fixed a bug in IpIsPrivate where 192.168.x.x was not recognized as a private ip.
This commit is contained in:
parent
32b81f057d
commit
e452ae3ea9
@ -142,6 +142,7 @@ void NetworkRemote::AcceptConnection() {
|
||||
if (only_non_public_ip_ && !IpIsPrivate(client_socket->peerAddress())) {
|
||||
qLog(Info) << "Got a connection from public ip" <<
|
||||
client_socket->peerAddress().toString();
|
||||
client_socket->close();
|
||||
} else {
|
||||
CreateRemoteClient(client_socket);
|
||||
}
|
||||
@ -153,7 +154,7 @@ bool NetworkRemote::IpIsPrivate(const QHostAddress& address) {
|
||||
address.isInSubnet(QHostAddress::parseSubnet("127.0.0.1/8")) ||
|
||||
// Link Local v6
|
||||
address.isInSubnet(QHostAddress::parseSubnet("::1/128")) ||
|
||||
address.isInSubnet(QHostAddress::parseSubnet("fe80::/10"));
|
||||
address.isInSubnet(QHostAddress::parseSubnet("fe80::/10")) ||
|
||||
// Private v4 range
|
||||
address.isInSubnet(QHostAddress::parseSubnet("192.168.0.0/16")) ||
|
||||
address.isInSubnet(QHostAddress::parseSubnet("172.16.0.0/12")) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user