ソースを参照

[Minor] Process DNS reply flags

tags/3.2
Vsevolod Stakhov 2年前
コミット
78ac4a61f7
2個のファイルの変更12行の追加3行の削除
  1. 6
    1
      contrib/librdns/rdns.h
  2. 6
    2
      contrib/librdns/resolver.c

+ 6
- 1
contrib/librdns/rdns.h ファイルの表示

@@ -129,13 +129,18 @@ enum dns_rcode {
RDNS_RC_NOREC = 13
};

enum dns_reply_flags {
RDNS_AUTH = (1u << 0u),
RDNS_TRUNCATED = (1u << 1u)
};

struct rdns_reply {
struct rdns_request *request;
struct rdns_resolver *resolver;
struct rdns_reply_entry *entries;
const char *requested_name;
enum dns_rcode code;
bool authenticated;
uint8_t flags; /* see enum dns_reply_flags */
};

typedef void (*rdns_periodic_callback)(void *user_data);

+ 6
- 2
contrib/librdns/resolver.c ファイルの表示

@@ -149,7 +149,7 @@ rdns_make_reply (struct rdns_request *req, enum dns_rcode rcode)
rep->entries = NULL;
rep->code = rcode;
req->reply = rep;
rep->authenticated = false;
rep->flags = 0;
rep->requested_name = req->requested_names[0].name;
}

@@ -223,7 +223,11 @@ rdns_parse_reply (uint8_t *in, int r, struct rdns_request *req,
rep = rdns_make_reply (req, header->rcode);

if (header->ad) {
rep->authenticated = true;
rep->flags |= RDNS_AUTH;
}

if (header->tc) {
rep->flags |= RDNS_TRUNCATED;
}

if (rep == NULL) {

読み込み中…
キャンセル
保存