dnsp.idl: fix the dnsp_dns_addr_array definition
authorStefan Metzmacher <metze@samba.org>
Tue, 30 Apr 2019 12:21:22 +0000 (14:21 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 21 Jun 2019 08:49:19 +0000 (08:49 +0000)
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>
librpc/idl/dnsp.idl
selftest/knownfail.d/dnsp
source4/torture/ndr/dnsp.c

index 55bac150990c04d01d41351baffc04d0c6da2221..3c35017a81b89acde9b11436146bca67dafb1483 100644 (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;
index 195feb4ca01dcff17053f59efdc1c1089ff113f9..212540708829dd2810c8c10843cfc97ee489fbbf 100644 (file)
@@ -1,2 +1 @@
-^samba4.local.ndr.*dnsp_DnsProperty_ZONE_MASTER_SERVERS_DA
 ^samba4.local.ndr.*dnsp_DnsProperty_DELETED_FROM_HOSTNAME
index 83d8346eb4f3cd2121499ecc3011508a99bedbd7..abe24b38b549026da62949aa90b4b81edd5e8820 100644 (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");