ndr: Another try to support the build on non-IPv6 systems
authorKai Blin <kai@samba.org>
Mon, 6 Dec 2010 06:43:35 +0000 (07:43 +0100)
committerMatthieu Patou <mat@samba.org>
Wed, 8 Dec 2010 09:26:00 +0000 (10:26 +0100)
Signed-off-by: Matthieu Patou <mat@matws.net>
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Dec  8 10:26:00 CET 2010 on sn-devel-104

librpc/ndr/ndr_basic.c

index 96f7323bfd90d08d296bc0485e023803b6a63cdb..ff207f4bb93f0a86fe76ef89fd6b11f4f50850ef 100644 (file)
@@ -848,7 +848,6 @@ _PUBLIC_ void ndr_print_ipv4address(struct ndr_print *ndr, const char *name,
        ndr->print(ndr, "%-25s: %s", name, address);
 }
 
-#ifdef AF_INET6
 /*
   pull a ipv6address
 */
@@ -877,6 +876,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_ipv6address(struct ndr_pull *ndr, int ndr_fl
 */
 _PUBLIC_ enum ndr_err_code ndr_push_ipv6address(struct ndr_push *ndr, int ndr_flags, const char *address)
 {
+#ifdef AF_INET6
        uint8_t addr[IPV6_BYTES];
        int ret;
 
@@ -893,6 +893,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_ipv6address(struct ndr_push *ndr, int ndr_fl
        NDR_CHECK(ndr_push_array_uint8(ndr, ndr_flags, addr, IPV6_BYTES));
 
        return NDR_ERR_SUCCESS;
+#else
+       return NDR_ERR_IPV6ADDRESS;
+#endif
 }
 
 /*
@@ -904,7 +907,6 @@ _PUBLIC_ void ndr_print_ipv6address(struct ndr_print *ndr, const char *name,
        ndr->print(ndr, "%-25s: %s", name, address);
 }
 #undef IPV6_BYTES
-#endif
 
 _PUBLIC_ void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type)
 {