[prev in list] [next in list] [prev in thread] [next in thread] 

List:       inn-workers
Subject:    Re: innfeed, bindaddress, force-ipv4, ipv6
From:       Russ Allbery <rra () stanford ! edu>
Date:       2008-04-18 9:10:59
Message-ID: 87ej934jfg.fsf () windlord ! stanford ! edu
[Download RAW message or body]

list-inn-workers@news.cistron.nl ("Miquel van Smoorenburg" ) writes:
> Julien ÉLIE  <julien@trigofacile.com> wrote:

>>I added:
>>
>>-      memcpy( &cxnSelf, bind_addr, sizeof(struct sockaddr_in) );
>>+      memcpy( (struct sockaddr_storage *)&cxnSelf, bind_addr,
>>
>>Is it a cast to (struct sockaddr_storage *) and not (struct
>>sockaddr_in/in6 *) or
>>(struct sockaddr *) which should be done?
>>--> const struct sockaddr_storage cxnAddr, cxnSelf ;
>
> Doesn't really matter - it looks like you're using the cast to
> make the implicit (const <type> *) to (<type> *) conversion explicit,
> you might as well use (void *) in the case of memcpy since that's
> memcpy's prototype.

Oh, it's to drop the const.

Yeah, it doesn't matter in that case.  (Casting to drop a const usually
means mis-structured code, but unwinding innfeed to try to do something
different is probably more trouble than it's worth for STABLE.)

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic