Changeset 989 for vendor/current/librpc/ndr
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- Location:
- vendor/current/librpc/ndr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/librpc/ndr/libndr.h
r988 r989 125 125 #define LIBNDR_FLAG_STR_RAW8 (1<<13) 126 126 #define LIBNDR_STRING_FLAGS (0x7FFC) 127 128 /* Disable string token compression */ 129 #define LIBNDR_FLAG_NO_COMPRESSION (1<<15) 127 130 128 131 /* -
vendor/current/librpc/ndr/ndr_dns.c
r988 r989 170 170 uint32_t offset; 171 171 172 /* see if we have pushed the remaining string already, 173 * if so we use a label pointer to this string 174 */ 175 ndr_err = ndr_token_retrieve_cmp_fn(&ndr->dns_string_list, s, 176 &offset, 177 (comparison_fn_t)strcmp, 178 false); 179 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 180 uint8_t b[2]; 181 182 if (offset > 0x3FFF) { 183 return ndr_push_error(ndr, NDR_ERR_STRING, 184 "offset for dns string " \ 185 "label pointer " \ 186 "%u[%08X] > 0x00003FFF", 187 offset, offset); 172 if (!(ndr->flags & LIBNDR_FLAG_NO_COMPRESSION)) { 173 /* see if we have pushed the remaining string already, 174 * if so we use a label pointer to this string 175 */ 176 ndr_err = ndr_token_retrieve_cmp_fn(&ndr->dns_string_list, s, 177 &offset, 178 (comparison_fn_t)strcmp, 179 false); 180 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 181 uint8_t b[2]; 182 183 if (offset > 0x3FFF) { 184 return ndr_push_error(ndr, NDR_ERR_STRING, 185 "offset for dns string " \ 186 "label pointer " \ 187 "%u[%08X] > 0x00003FFF", 188 offset, offset); 189 } 190 191 b[0] = 0xC0 | (offset>>8); 192 b[1] = (offset & 0xFF); 193 194 return ndr_push_bytes(ndr, b, 2); 188 195 } 189 190 b[0] = 0xC0 | (offset>>8);191 b[1] = (offset & 0xFF);192 193 return ndr_push_bytes(ndr, b, 2);194 196 } 195 197 … … 214 216 * so it can be reused later 215 217 */ 216 NDR_CHECK(ndr_token_store(ndr, &ndr->dns_string_list, s, 217 ndr->offset)); 218 if (!(ndr->flags & LIBNDR_FLAG_NO_COMPRESSION)) { 219 NDR_CHECK(ndr_token_store(ndr, &ndr->dns_string_list, s, 220 ndr->offset)); 221 } 218 222 219 223 /* push just this component into the blob */ … … 265 269 LIBNDR_FLAG_NOALIGN); 266 270 if (ndr_flags & NDR_SCALARS) { 271 uint32_t _flags_save_name = ndr->flags; 272 267 273 NDR_CHECK(ndr_push_align(ndr, 4)); 274 275 switch (r->rr_type) { 276 case DNS_QTYPE_TKEY: 277 case DNS_QTYPE_TSIG: 278 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NO_COMPRESSION); 279 break; 280 default: 281 break; 282 } 268 283 NDR_CHECK(ndr_push_dns_string(ndr, NDR_SCALARS, r->name)); 284 ndr->flags = _flags_save_name; 285 269 286 NDR_CHECK(ndr_push_dns_qtype(ndr, NDR_SCALARS, r->rr_type)); 270 287 NDR_CHECK(ndr_push_dns_qclass(ndr, NDR_SCALARS, r->rr_class));
Note:
See TracChangeset
for help on using the changeset viewer.