[Asterisk-code-review] DNS: Create a system-level DNS resolver (asterisk[master])

Ashley Sanders asteriskteam at digium.com
Tue Jul 7 19:43:56 CDT 2015


Ashley Sanders has posted comments on this change.

Change subject: DNS: Create a system-level DNS resolver
......................................................................


Patch Set 5:

(2 comments)

https://gerrit.asterisk.org/#/c/749/5/main/dns.c
File main/dns.c:

Line 250: static int dns_search_res_n(const char *dname, int rr_class, int rr_type,
> It's not. You can have a mix of both by moving the define checks outside an
I attempted to do as you suggested but I ended up with some issues. If I put the conditionals on the outside of the two implementations of the function, as in:

    #ifdef HAVE_RES_NINT
    static int foo(...)
    {
        ...
    }

    #else
    static int foo(...)
    {
        ...
    }
    #endif

I get many compiler errors. But the main one is when I attempt to invoke foo:

    error: implicit declaration of function ‘foo’ [-Werror=implicit-function-declaration

If I am to put the conditionals inside of the function body like this:

    static int foo (...)
    {
    #ifdef HAVE_RES_NINT
         ...
    #else
         ...
    #endif
    }

I am going to have the same situation that I was trying to avoid (see ast_search_dns, line 496). I think the way that I have it is about as good as I can get it to accomplish easier readability.

During the process of this exercise, though, I did find a mistake on line 260. It should have read (because this line would only be present on a system without RES_NINIT):

    dns_response_len = res_search(&dns_state,


https://gerrit.asterisk.org/#/c/749/5/main/dns_system_resolver.c
File main/dns_system_resolver.c:

Line 145: 	int res = ast_search_dns_ex(query,
> If ast_search_dns_ex() has its signature changed, then you'd also want to c
Done.


-- 
To view, visit https://gerrit.asterisk.org/749
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3b36ea17b889a98df4f8d80d50bb7ee175afa077
Gerrit-PatchSet: 5
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list