diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-02-07 11:26:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:48 -0500 |
commit | ce07cefdb041979c8d363ef6c021dbae34a10d79 (patch) | |
tree | 05b6519428ef0187e8967eb45b130d76e9ad463a /source3/libaddns | |
parent | 995a9164818e67d5b82d5f4e52b347d752660d12 (diff) | |
download | samba-ce07cefdb041979c8d363ef6c021dbae34a10d79.tar.gz samba-ce07cefdb041979c8d363ef6c021dbae34a10d79.tar.xz samba-ce07cefdb041979c8d363ef6c021dbae34a10d79.zip |
r21217: Just found a system that does not define in_addr_t but only struct
in_addr. Okay, it's a SuSE 7.0, but if the fix is so simple I think we should
not drop that :-)
Volker
(This used to be commit a5d0d1c1e63c63388540a24854bde380cd4b06bf)
Diffstat (limited to 'source3/libaddns')
-rw-r--r-- | source3/libaddns/dns.h | 7 | ||||
-rw-r--r-- | source3/libaddns/dnsrecord.c | 14 |
2 files changed, 12 insertions, 9 deletions
diff --git a/source3/libaddns/dns.h b/source3/libaddns/dns.h index 9e8cc1d155..6f480a5469 100644 --- a/source3/libaddns/dns.h +++ b/source3/libaddns/dns.h @@ -405,13 +405,16 @@ DNS_ERROR dns_create_tkey_record(TALLOC_CTX *mem_ctx, const char *keyname, struct dns_rrec **prec); DNS_ERROR dns_create_name_in_use_record(TALLOC_CTX *mem_ctx, const char *name, - const in_addr_t *ip, + const struct in_addr *ip, struct dns_rrec **prec); DNS_ERROR dns_create_delete_record(TALLOC_CTX *mem_ctx, const char *name, uint16 type, uint16 r_class, struct dns_rrec **prec); +DNS_ERROR dns_create_name_not_in_use_record(TALLOC_CTX *mem_ctx, + const char *name, uint32 type, + struct dns_rrec **prec); DNS_ERROR dns_create_a_record(TALLOC_CTX *mem_ctx, const char *host, - uint32 ttl, in_addr_t ip, + uint32 ttl, struct in_addr ip, struct dns_rrec **prec); DNS_ERROR dns_unmarshall_tkey_record(TALLOC_CTX *mem_ctx, struct dns_rrec *rec, struct dns_tkey_record **ptkey); diff --git a/source3/libaddns/dnsrecord.c b/source3/libaddns/dnsrecord.c index 11c6884d9d..37a5886af7 100644 --- a/source3/libaddns/dnsrecord.c +++ b/source3/libaddns/dnsrecord.c @@ -121,19 +121,19 @@ DNS_ERROR dns_create_rrec(TALLOC_CTX *mem_ctx, const char *name, } DNS_ERROR dns_create_a_record(TALLOC_CTX *mem_ctx, const char *host, - uint32 ttl, in_addr_t ip, + uint32 ttl, struct in_addr ip, struct dns_rrec **prec) { uint8 *data; DNS_ERROR err; - if (!(data = (uint8 *)TALLOC_MEMDUP(mem_ctx, (const void *)&ip, - sizeof(ip)))) { + if (!(data = (uint8 *)TALLOC_MEMDUP(mem_ctx, (const void *)&ip.s_addr, + sizeof(ip.s_addr)))) { return ERROR_DNS_NO_MEMORY; } err = dns_create_rrec(mem_ctx, host, QTYPE_A, DNS_CLASS_IN, ttl, - sizeof(ip), data, prec); + sizeof(ip.s_addr), data, prec); if (!ERR_DNS_IS_OK(err)) { TALLOC_FREE(data); @@ -144,7 +144,7 @@ DNS_ERROR dns_create_a_record(TALLOC_CTX *mem_ctx, const char *host, DNS_ERROR dns_create_name_in_use_record(TALLOC_CTX *mem_ctx, const char *name, - const in_addr_t *ip, + const struct in_addr *ip, struct dns_rrec **prec) { if (ip != NULL) { @@ -338,7 +338,7 @@ DNS_ERROR dns_create_probe(TALLOC_CTX *mem_ctx, const char *zone, for (i=0; i<num_ips; i++) { err = dns_create_name_in_use_record(req, host, - &iplist[i].s_addr, &rec); + &iplist[i], &rec); if (!ERR_DNS_IS_OK(err)) goto error; err = dns_add_rrec(req, rec, &req->num_preqs, &req->preqs); @@ -395,7 +395,7 @@ DNS_ERROR dns_create_update_request(TALLOC_CTX *mem_ctx, */ for ( i=0; i<num_addrs; i++ ) { - err = dns_create_a_record(req, hostname, 3600, ip_addrs[i].s_addr, &rec); + err = dns_create_a_record(req, hostname, 3600, ip_addrs[i], &rec); if (!ERR_DNS_IS_OK(err)) goto error; |