We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8593e1f commit e47b93dCopy full SHA for e47b93d
src/backend/utils/adt/network.c
@@ -3,7 +3,7 @@
3
* is for IP V4 CIDR notation, but prepared for V6: just
4
* add the necessary bits where the comments indicate.
5
*
6
- * $Id: network.c,v 1.9 1999/05/25 16:12:11 momjian Exp $
+ * $Id: network.c,v 1.10 1999/06/02 03:37:15 momjian Exp $
7
* Jon Postel RIP 16 Oct 1998
8
*/
9
@@ -306,8 +306,16 @@ network_cmp(inet *a1, inet *a2)
306
{
307
if (ntohl(ip_v4addr(a1)) < ntohl(ip_v4addr(a2)))
308
return (-1);
309
- else if (ntohl(ip_v4addr(a1)) > ntohl(ip_v4addr(a2)))
+
310
+ if (ntohl(ip_v4addr(a1)) > ntohl(ip_v4addr(a2)))
311
+ return (1);
312
313
+ if (ip_bits(a1) < ip_bits(a2))
314
+ return (-1);
315
316
+ if (ip_bits(a1) > ip_bits(a2))
317
return (1);
318
319
return 0;
320
}
321
0 commit comments