1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

dnsp.idl: fix the dnsp_dns_addr_array definition

The endian changes are needed in order to get the following result
from the blobs Windows generated (see the torture test):

  AddrArray: ARRAY(3)
      AddrArray: struct dnsp_dns_addr
          family                   : 0x0002 (2)
          port                     : 0x0035 (53)
          ipv4                     : 172.31.99.33
          ipv6                     : 0000:0000:0000:0000:0000:0000:0000:0000

[MS-DNSP] states that the port is supposed to be ignored, but it's still
good to decode it as port '53' (0x0035) instead of '13568' (0x3500).

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>
This commit is contained in:
Stefan Metzmacher 2019-04-30 14:21:22 +02:00 committed by Andrew Bartlett
parent 6d958af0b4
commit 6fc7cc1504
3 changed files with 4 additions and 3 deletions

View File

@ -174,8 +174,8 @@ interface dnsp
typedef struct {
uint16 family;
uint16 port;
ipv4address ipv4;
[flag(NDR_BIG_ENDIAN)] uint16 port;
[flag(NDR_BIG_ENDIAN)] ipv4address ipv4;
ipv6address ipv6;
uint8 pad[8];
uint32 unused[8];
@ -187,6 +187,7 @@ interface dnsp
uint32 Tag;
uint16 Family;
uint16 Reserved0;
uint32 Flags;
uint32 MatchFlag;
uint32 Reserved1;
uint32 Reserved2;

View File

@ -1,2 +1 @@
^samba4.local.ndr.*dnsp_DnsProperty_ZONE_MASTER_SERVERS_DA
^samba4.local.ndr.*dnsp_DnsProperty_DELETED_FROM_HOSTNAME

View File

@ -217,6 +217,7 @@ static bool dnsp_dnsProperty_addr_array_check(struct torture_context *tctx,
torture_assert_int_equal(tctx, da->Tag, 0, "Tag");
torture_assert_int_equal(tctx, da->Family, 0, "Family");
torture_assert_int_equal(tctx, da->Reserved0, 0, "Reserved0");
torture_assert_int_equal(tctx, da->Flags, 0, "Flags");
torture_assert_int_equal(tctx, da->MatchFlag, 0, "MatchFlag");
torture_assert_int_equal(tctx, da->Reserved1, 0, "Reserved1");
torture_assert_int_equal(tctx, da->Reserved2, 0, "Reserved2");