Cast the original rcode to (dns_ttl_t) when setting extended rcode
requested to merge 2095-shifting-large-rcode-in-dns-message-c-results-in-undefined-behaviour-v9_11 into v9_11
Shifting (signed) integer left could trigger undefined behaviour when the shifted value would overflow into the sign bit (e.g. 2048).
The issue was found when using AFL++ and UBSAN:
message.c:2274:33: runtime error: left shift of 2048 by 20 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior message.c:2274:33 in
(cherry picked from commit a3476417)
Closes #2095 (closed)