This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] getaddrinfo() dest. addr. selection Rule 7 bugfix


Sridhar Samudrala wrote:
> The following patch fixes Rule 7(Prefer native transport) in the destination 
> address selection process as implemented by getaddrinfo().

I don't like the patch at all.  Yes, your test for native transport is
correct but the cost is too high.

First, we already open a NETLINK_ROUTE socket once, in __check_pf.  The
code should piggy back on that.  This means reworking how __check_pf is
used or even works.  The socket has to be created unconditionally while
the __check_pf body as it exists today should run as before conditional.
 You'll need to separate opening the socket from the __check_pf code.

Second, the if_name2type code uses yet more syscalls.  These are only
needed if we ever reach rule 7.  So, delay this work.  And in that
situation you can use the same socket for both interfaces.

Third, don't introduce new fields in struct sort_result for yes/no
information.  You replace in6ai_temporary, which should have given you
the hint that you should use a flag.  Maybe this is obsoleted by the
second point above.  In any case, if you remove in6ai_temporary support
in getaddrinfo.c you also have to remove it where the flag is generated
(in check_pf.c).

Fourth, your changes violate all kinds of rules of the coding standard.
 Respect how the rest of the code looks like.  Learn the rules.

-- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]