I am on a postgresql 8.3 database. I am trying to figure out where the mistake is in the query below. I am trying to design a query to only select source_ips and destination_ips that are private addresses.
For some reason one of the addresses that is grabbed in the query below is the address 208.117.252.39 which is not a private address.
Is there something wrong with the logic in the query below that would make it select public IP addresses as well?
select source_ip, destination_ip
from ip_table
where
(
inet '10/8' >> source_ip
or inet '192.168/16' >> source_ip
or source_ip >= inet '172.16/16' and source_ip < inet '172.32/16'
)
and inet '10/8' >> destination_ip
or inet '192.168/16' >> destination_ip