[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] [PATCH] disclose TTL for negative answers
On Thu, Sep 1, 2011 at 18:36, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:
> When you say
> + Â Â Â if ((flags & 0x020f) && (flags & 0x020f) != DNS_ERR_NOTEXIST) {
> + Â Â Â Â Â Â Â /* there was an error and it's not NXDOMAIN */
>
> I don't see how (flags & 0x020f) != DNS_ERR_NOTEXIST could ever be
> false. ÂDNS_ERR_NOTEXIST is 3, and (flags & 0x020f) is either 0x020f
> or 0.
>
> Am I missing something, or did you mean to check something else here?
Hi Nick,
(flags & 0x20F) is not either 0x020F or 0, it can easily be 0x200, for
example, for truncated OK message.
"&" is binary "and", not logic "and". Logic "and" is "&&".
So (flags & 0x020f == DNS_ERR_NOTEXIST) is true only for non-truncated
answer with code 3 (NXDOMAIN) - that's the only error answer I want to
parse looking for SOA record.
Am I missing anything?
--
WBRBW, Leonid Evdokimov
xmpp:leon@xxxxxxxxxxxx && http://darkk.net.ru
tel:+79816800702 && tel:+79050965222
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.