|
|
|
@ -3,7 +3,7 @@ |
|
|
|
|
* is for IP V4 CIDR notation, but prepared for V6: just |
|
|
|
|
* add the necessary bits where the comments indicate. |
|
|
|
|
* |
|
|
|
|
* $Id: inet.c,v 1.3 1998/10/12 04:07:46 momjian Exp $ |
|
|
|
|
* $Id: inet.c,v 1.4 1998/10/17 03:59:13 momjian Exp $ |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#include <sys/types.h> |
|
|
|
@ -57,9 +57,7 @@ inet_in(char *src) |
|
|
|
|
} |
|
|
|
|
/* First, try for an IP V4 address: */ |
|
|
|
|
ip_family(dst) = AF_INET; |
|
|
|
|
#ifdef BAD |
|
|
|
|
bits = inet_net_pton(ip_family(dst), src, &ip_v4addr(dst), ip_addrsize(dst), NULL); |
|
|
|
|
#endif |
|
|
|
|
if ((bits < 0) || (bits > 32)) |
|
|
|
|
{ |
|
|
|
|
/* Go for an IPV6 address here, before faulting out: */ |
|
|
|
@ -86,7 +84,6 @@ inet_out(inet *src) |
|
|
|
|
|
|
|
|
|
if (ip_family(src) == AF_INET) |
|
|
|
|
{ |
|
|
|
|
#ifdef BAD |
|
|
|
|
/* It's an IP V4 address: */ |
|
|
|
|
if (inet_net_ntop(AF_INET, &ip_v4addr(src), 4, ip_bits(src), |
|
|
|
|
tmp, sizeof(tmp)) < 0) |
|
|
|
@ -94,7 +91,6 @@ inet_out(inet *src) |
|
|
|
|
elog(ERROR, "unable to print address (%s)", strerror(errno)); |
|
|
|
|
return (NULL); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|