mirror of
https://github.com/samba-team/samba.git
synced 2025-01-20 14:03:59 +03:00
dnsp.idl: fix dnsp_ip4_array definition
In future we should use ipv4address, but that would result in a much larger change. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13969 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit 6d958af0b4cb6fd45cfda0298243859b3b043c6f)
This commit is contained in:
parent
7dbde4521f
commit
e7dfe3f7f7
@ -169,7 +169,7 @@ interface dnsp
|
||||
|
||||
typedef struct {
|
||||
uint32 addrCount;
|
||||
[size_is(addrCount)] uint32 *addr;
|
||||
uint32 addrArray[addrCount];
|
||||
} dnsp_ip4_array;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1,3 +1,2 @@
|
||||
^samba4.local.ndr.*dnsp_DnsProperty_ZONE_MASTER_SERVERS
|
||||
^samba4.local.ndr.*dnsp_DnsProperty_ZONE_MASTER_SERVERS_DA
|
||||
^samba4.local.ndr.*dnsp_DnsProperty_DELETED_FROM_HOSTNAME
|
||||
|
@ -774,7 +774,7 @@ static struct IP4_ARRAY *copy_ip4_array(TALLOC_CTX *ctx,
|
||||
}
|
||||
|
||||
for (i = 0; i < ip4_array->AddrCount; i++) {
|
||||
ip4_array->AddrArray[i] = array.addr[i];
|
||||
ip4_array->AddrArray[i] = array.addrArray[i];
|
||||
}
|
||||
|
||||
return ip4_array;
|
||||
|
@ -68,7 +68,7 @@ static void test_dnsserver_init_zoneinfo_master_servers_empty(void **state)
|
||||
assert_non_null(property);
|
||||
property->id = DSPROPERTY_ZONE_MASTER_SERVERS;
|
||||
property->data.master_servers.addrCount = 0;
|
||||
property->data.master_servers.addr = NULL;
|
||||
property->data.master_servers.addrArray = NULL;
|
||||
|
||||
zone->tmp_props = property;
|
||||
zone->num_props = 1;
|
||||
@ -122,12 +122,12 @@ static void test_dnsserver_init_zoneinfo_master_servers(void **state)
|
||||
assert_non_null(property);
|
||||
property->id = DSPROPERTY_ZONE_MASTER_SERVERS;
|
||||
property->data.master_servers.addrCount = 4;
|
||||
property->data.master_servers.addr =
|
||||
property->data.master_servers.addrArray =
|
||||
talloc_zero_array(ctx, uint32_t, 4);
|
||||
property->data.master_servers.addr[0] = 1000;
|
||||
property->data.master_servers.addr[1] = 1001;
|
||||
property->data.master_servers.addr[2] = 1002;
|
||||
property->data.master_servers.addr[3] = 1003;
|
||||
property->data.master_servers.addrArray[0] = 1000;
|
||||
property->data.master_servers.addrArray[1] = 1001;
|
||||
property->data.master_servers.addrArray[2] = 1002;
|
||||
property->data.master_servers.addrArray[3] = 1003;
|
||||
|
||||
zone->tmp_props = property;
|
||||
zone->num_props = 1;
|
||||
@ -163,11 +163,11 @@ static void test_dnsserver_init_zoneinfo_master_servers(void **state)
|
||||
* the values in the property without affecting the zoneinfo data
|
||||
*/
|
||||
assert_true(zoneinfo->aipLocalMasters->AddrArray !=
|
||||
property->data.master_servers.addr);
|
||||
property->data.master_servers.addr[0] = 0;
|
||||
property->data.master_servers.addr[1] = 1;
|
||||
property->data.master_servers.addr[2] = 2;
|
||||
property->data.master_servers.addr[3] = 3;
|
||||
property->data.master_servers.addrArray);
|
||||
property->data.master_servers.addrArray[0] = 0;
|
||||
property->data.master_servers.addrArray[1] = 1;
|
||||
property->data.master_servers.addrArray[2] = 2;
|
||||
property->data.master_servers.addrArray[3] = 3;
|
||||
assert_int_equal(zoneinfo->aipLocalMasters->AddrArray[0], 1000);
|
||||
assert_int_equal(zoneinfo->aipLocalMasters->AddrArray[1], 1001);
|
||||
assert_int_equal(zoneinfo->aipLocalMasters->AddrArray[2], 1002);
|
||||
@ -199,7 +199,7 @@ static void test_dnsserver_init_zoneinfo_scavenging_servers_empty(void **state)
|
||||
assert_non_null(property);
|
||||
property->id = DSPROPERTY_ZONE_SCAVENGING_SERVERS;
|
||||
property->data.servers.addrCount = 0;
|
||||
property->data.servers.addr = NULL;
|
||||
property->data.servers.addrArray = NULL;
|
||||
|
||||
zone->tmp_props = property;
|
||||
zone->num_props = 1;
|
||||
@ -241,11 +241,11 @@ static void test_dnsserver_init_zoneinfo_scavenging_servers(void **state)
|
||||
assert_non_null(property);
|
||||
property->id = DSPROPERTY_ZONE_SCAVENGING_SERVERS;
|
||||
property->data.servers.addrCount = 4;
|
||||
property->data.servers.addr = talloc_zero_array(ctx, uint32_t, 4);
|
||||
property->data.servers.addr[0] = 1000;
|
||||
property->data.servers.addr[1] = 1001;
|
||||
property->data.servers.addr[2] = 1002;
|
||||
property->data.servers.addr[3] = 1003;
|
||||
property->data.servers.addrArray = talloc_zero_array(ctx, uint32_t, 4);
|
||||
property->data.servers.addrArray[0] = 1000;
|
||||
property->data.servers.addrArray[1] = 1001;
|
||||
property->data.servers.addrArray[2] = 1002;
|
||||
property->data.servers.addrArray[3] = 1003;
|
||||
|
||||
zone->tmp_props = property;
|
||||
zone->num_props = 1;
|
||||
@ -273,11 +273,11 @@ static void test_dnsserver_init_zoneinfo_scavenging_servers(void **state)
|
||||
* the values in the property without affecting the zoneinfo data
|
||||
*/
|
||||
assert_true(zoneinfo->aipScavengeServers->AddrArray !=
|
||||
property->data.servers.addr);
|
||||
property->data.servers.addr[0] = 0;
|
||||
property->data.servers.addr[1] = 1;
|
||||
property->data.servers.addr[2] = 2;
|
||||
property->data.servers.addr[3] = 3;
|
||||
property->data.servers.addrArray);
|
||||
property->data.servers.addrArray[0] = 0;
|
||||
property->data.servers.addrArray[1] = 1;
|
||||
property->data.servers.addrArray[2] = 2;
|
||||
property->data.servers.addrArray[3] = 3;
|
||||
assert_int_equal(zoneinfo->aipScavengeServers->AddrArray[0], 1000);
|
||||
assert_int_equal(zoneinfo->aipScavengeServers->AddrArray[1], 1001);
|
||||
assert_int_equal(zoneinfo->aipScavengeServers->AddrArray[2], 1002);
|
||||
|
@ -68,8 +68,8 @@ static bool dnsp_dnsProperty_ip4_array_check(struct torture_context *tctx,
|
||||
* 0x21631fac is 172.31.99.33
|
||||
* 0x2c631fac is 172.31.99.44
|
||||
*/
|
||||
torture_assert_int_equal(tctx, r->data.master_servers.addr[0], 0x21631fac, "addr[0]");
|
||||
torture_assert_int_equal(tctx, r->data.master_servers.addr[1], 0x2c631fac, "addr[1]");
|
||||
torture_assert_int_equal(tctx, r->data.master_servers.addrArray[0], 0x21631fac, "addrArray[0]");
|
||||
torture_assert_int_equal(tctx, r->data.master_servers.addrArray[1], 0x2c631fac, "addrArray[1]");
|
||||
torture_assert_int_equal(tctx, r->name, 0, "name");
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user