]> granicus.if.org Git - postgresql/blobdiff - src/backend/utils/adt/inet_net_pton.c
Add support for EUI-64 MAC addresses as macaddr8
[postgresql] / src / backend / utils / adt / inet_net_pton.c
index 0ef217b110dc0ea3eb14330eb6ff0ee6233b8a29..be788d37cd070eadb3ceac8a1fc7cd4c532077e2 100644 (file)
@@ -23,13 +23,14 @@ static const char rcsid[] = "Id: inet_net_pton.c,v 1.4.2.3 2004/03/17 00:40:11 m
 
 #include "postgres.h"
 
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <assert.h>
 #include <ctype.h>
 
+#include "utils/builtins.h" /* pgrminclude ignore */   /* needed on some
+                                                                                                                * platforms */
 #include "utils/inet.h"
 
 
@@ -494,7 +495,7 @@ inet_cidr_pton_ipv6(const char *src, u_char *dst, size_t size)
                        else if (*src == '\0')
                                goto enoent;
                        if (tp + NS_INT16SZ > endp)
-                               return (0);
+                               goto enoent;
                        *tp++ = (u_char) (val >> 8) & 0xff;
                        *tp++ = (u_char) val & 0xff;
                        saw_xdigit = 0;