lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #33485] SOCK_ADDR_TYPE_MATCH and SOCK_ADDR_TYPE_MATCH_


From: Bill Auerbach
Subject: [lwip-devel] [bug #33485] SOCK_ADDR_TYPE_MATCH and SOCK_ADDR_TYPE_MATCH_OR_UNSPEC use error
Date: Mon, 06 Jun 2011 20:41:24 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

Follow-up Comment #4, bug #33485 (project lwip):

>I don't see why I would end up with 16 bytes unless IPv6 is turned on...

Regardless of IPV6 being on or off, this is because alignment1 and alignment2
could become 32-bit aligned.  The compiler might well generate this with
padding:


struct sockaddr_aligned {
           u8_t  sa_len;
char pad[3];
           u8_t  sa_family;
char pad[3];
           u16_t alignment1;
char pad[2];
           u32_t alignment2;
         #if LWIP_IPV6
           u8_t sa_data[SIN_ZERO_LEN + 8];
         #else /* LWIP_IPV6 */
           u8_t sa_data[SIN_ZERO_LEN];
         #endif /* LWIP_IPV6 */
         };


I get it better now that it's an internal thing only.  I guess it will fall
out in the end.  Maybe until sometime later and it's gotten some mileage it's
worth an LWIP_ASSERT to be sure it's always is as you require?  I wouldn't
benchmark with the asserts though if this is often used.

I know you're well aware that there are several platforms and several
compilers and the combinations are possibly P*C.  I'm trying to think about it
from this angle.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?33485>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]