Re: [PATCH] Use '@interface' for link-local DNS servers in the dnsmasq config



On Wed, 2011-08-24 at 14:09 +0200, Michael Stapelberg wrote:
> Hi Dan,
> 
> Excerpts from Dan Williams's message of 2011-08-20 00:47:59 +0200:
> > Thanks!  Though we do risk buffer overflows because the buffer being
> > passed into the function is only INET6_ADDRSTRLEN long, so we need to be
> > more careful here when appending the interface name. I've reworked that
> > a bit, can you test the attached patch and make sure it does the same
> > thing yours does?  It's compile-tested but not run tested.  When I
> > commit you'll still get credit, of course.  Thanks for looking into
> > this.
> Your version of the patch has a little flaw: It only handles the case where
> inet_ntop() already returns an address with %interface in it (and replaces the
> % with an @ sign). However, on Linux, inet_ntop() does not return a scope
> % identifier at all. In this case, we append @interface.
> 
> I reworked the code and added a better comment, so hopefully the two cases are
> clear now.

Pushed to 0.9 and 0.8 with a small fix to avoid the extra allocation
when the interface is not returned.  If you can re-verify my
g_strdup_printf -> strncat conversion that'd be great.

Thanks!
Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]