tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: in_pcbsetport(), in6_pcbsetport()



On Wed, Apr 29, 2009 at 08:01:33PM +0300, Elad Efrat wrote:
> Hi,
> 
> Attached is a diff that implements the following changes:
> 
>   - in6_pcbbind_{addr,port}() become static (I should have done this
>     before).
> 
>   - in_pcbsetport(), in6_pcbsetport() properly authorize port binding.
>     This is just a first part, I'm about to add a new request to
>     indicate "auto-assign", but it shouldn't stand in the way of the
>     changes here.
> 
>   - Pass sockaddr_in6 to in6_pcbsetport(), similarly to its netinet
>     counterpart. Craft one in udp6_output() where we don't have it in
>     our context.
> 
>   - Don't pass "laddr" to the aforementioned functions, as it's
>     redundant now that both take a sockaddr_in{,6}.
> 
> Please review. No change in functionality is expected, but I'd like
> eyes on this from people who are more familiar with the IPv6 stack.

It looks like in udp6_output.c you're going to change in6_any.sin6_addr,
I can't see how this can be right (if pr_domain is const there's probably
a reason :). You should copy the content to a local sockaddr_in6 instead.

BTW, you did a similar change to the netinet/ code, with a UNCONST here too.
While it may be safe here (it seems you're not writing to the pointer),
it would be better to not use UNCONST() here and make the pointer's
copy const instead.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index