r16690: - fix bug 3896
authorStefan Metzmacher <metze@samba.org>
Thu, 29 Jun 2006 18:56:09 +0000 (18:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:09:38 +0000 (14:09 -0500)
- we didn't pushed the wins wack reply correctly to the wire,
  as NBT_QTYPE_NETBIOS is used and setting rdata.data.data was useless...

metze
(This used to be commit d3556e18892c0540e92f560f9d6b1b5587e41a62)

source4/librpc/idl/nbt.idl

index 65ae20111e6fc918cb3309beb30527fdd334d314..32f069c8deca15aca11ecb08475b50580d52626d 100644 (file)
                [default]                 nbt_rdata_data   data;
        } nbt_rdata;
 
+/*
+ * this macro works arround the problem
+ * that we need to use nbt_rdata_data
+ * together with NBT_QTYPE_NETBIOS
+ * for WACK replies
+ */
+#define NBT_RES_REC_LEVEL(rr_type, rdata) (\
+       (((rr_type) == NBT_QTYPE_NETBIOS) && ((rdata).data.length == 2)) \
+       ? 0 : rr_type)
+
        typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct {
                nbt_name   name;
                nbt_qtype  rr_type;
                nbt_qclass rr_class;
                uint32     ttl;
-               [switch_is(rr_type)] nbt_rdata rdata;
+               [switch_is(NBT_RES_REC_LEVEL(rr_type, rdata))] nbt_rdata rdata;
        } nbt_res_rec;
 
        typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {