int tries = 3;
int lookup_counter = 0;
+#ifdef ISC_PLATFORM_USESIT
+static char sitvalue[256];
+#endif
+
#ifdef WITH_IDN
static void initialize_idn(void);
static isc_result_t output_filter(isc_buffer_t *buffer,
isc_buffer_t hexbuf;
size_t len;
const unsigned char *sit;
+ isc_boolean_t copysit;
isc_result_t result;
if (l->sitvalue != NULL) {
check_result(result, "isc_hex_decodestring");
sit = isc_buffer_base(&hexbuf);
len = isc_buffer_usedlength(&hexbuf);
+ copysit = ISC_FALSE;
} else {
sit = cookie;
len = sizeof(cookie);
+ copysit = ISC_TRUE;
}
INSIST(msg->sitok == 0 && msg->sitbad == 0);
} else {
printf(";; Warning: SIT client cookie mismatch\n");
msg->sitbad = 1;
+ copysit = ISC_FALSE;
}
} else {
printf(";; Warning: SIT bad token (too short)\n");
msg->sitbad = 1;
+ copysit = ISC_FALSE;
+ }
+ if (copysit) {
+ isc_region_t r;
+
+ r.base = isc_buffer_current(optbuf);
+ r.length = (unsigned int)optlen;
+ isc_buffer_init(&hexbuf, sitvalue, sizeof(sitvalue));
+ result = isc_hex_totext(&r, 2, "", &hexbuf);
+ check_result(result, "isc_hex_totext");
+ if (isc_buffer_availablelength(&hexbuf) > 0) {
+ isc_buffer_putuint8(&hexbuf, 0);
+ l->sitvalue = sitvalue;
+ }
}
isc_buffer_forward(optbuf, (unsigned int)optlen);
}
}
if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0 &&
!l->ignore && !l->tcp_mode) {
+#ifdef ISC_PLATFORM_USESIT
+ if (l->sitvalue == NULL && l->sit && msg->opt != NULL)
+ process_opt(l, msg);
+#endif
if (l->comments)
printf(";; Truncated, retrying in TCP mode.\n");
n = requeue_lookup(l, ISC_TRUE);
#!/bin/sh
#
-# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
}' < $1
}
+fullsit() {
+ awk 'BEGIN { n = 0 }
+ // { v[n++] = length(); }
+ END { print (v[1] == v[2]); }'
+}
+
havetc() {
grep 'flags:.* tc[^;]*;' $1 > /dev/null
}
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+n=`expr $n + 1`
+echo "I:checking SIT is learnt for TCP retry ($n)"
+ret=0
+$DIG +qr +sit large.example txt @10.53.0.1 -p 5300 > dig.out.test$n
+linecount=`getsit dig.out.test$n | wc -l`
+if [ $linecount != 3 ]; then ret=1; fi
+checkfull=`getsit dig.out.test$n | fullsit`
+if [ $checkfull != 1 ]; then ret=1; fi
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
n=`expr $n + 1`
echo "I:checking for SIT value in adb ($n)"
ret=0
[RT #37927]
</para>
</listitem>
+ <listitem>
+ <para>
+ When retrying a query via TCP due to the first answer being
+ truncated, <command>dig</command> will now correctly send
+ the SIT (server identity token) value returned by the server
+ in the prior response. [RT #39047]
+ </para>
+ </listitem>
</itemizedlist>
</sect2>
<sect2 id="relnotes_bugs">