projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5959c73
)
The INET and CIDR types mistakenly compared 198.68.123.0/24 and
author
Bruce Momjian
<
[email protected]
>
Wed, 2 Jun 1999 03:37:15 +0000
(
03:37
+0000)
committer
Bruce Momjian
<
[email protected]
>
Wed, 2 Jun 1999 03:37:15 +0000
(
03:37
+0000)
198.68.123.0/27 the same when indexing them.
D'Arcy
src/backend/utils/adt/network.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/utils/adt/network.c
b/src/backend/utils/adt/network.c
index 95d84ed0b02d29448d10ada31775a06971f48660..a3ad62a46fdd70017d52dceaf319475c7a319c6d 100644
(file)
--- a/
src/backend/utils/adt/network.c
+++ b/
src/backend/utils/adt/network.c
@@
-306,8
+306,16
@@
network_cmp(inet *a1, inet *a2)
{
if (ntohl(ip_v4addr(a1)) < ntohl(ip_v4addr(a2)))
return (-1);
- else if (ntohl(ip_v4addr(a1)) > ntohl(ip_v4addr(a2)))
+
+ if (ntohl(ip_v4addr(a1)) > ntohl(ip_v4addr(a2)))
+ return (1);
+
+ if (ip_bits(a1) < ip_bits(a2))
+ return (-1);
+
+ if (ip_bits(a1) > ip_bits(a2))
return (1);
+
return 0;
}