lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #5846] struct sockaddr_in has different alignment th


From: Simon Goldschmidt
Subject: [lwip-devel] [patch #5846] struct sockaddr_in has different alignment than struct sockaddr
Date: Mon, 02 Apr 2007 20:32:37 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

URL:
  <http://savannah.nongnu.org/patch/?5846>

                 Summary: struct sockaddr_in has different alignment than
struct sockaddr
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: goldsimon
            Submitted on: Montag 02.04.2007 um 20:32
                Category: None
                Priority: 3 - Low
                  Status: In Progress
                 Privacy: Public
             Assigned to: goldsimon
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Because struct sockaddr only includes u8_t values, it is byte-aligned, while
struct sockaddr_in is 4-byte-aligned (because of in_addr).

In the attached patch, I've solved this by including different 'alignment'
members in struct sockaddr depending on MEM_ALIGNMENT. Another (less cleaner)
solution would be to just integrate a union including a struct ip_addr, this
way alignment would always be the same.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Montag 02.04.2007 um 20:32  Name: sockets_alignment.patch  Size: 724B  
By: goldsimon

<http://savannah.nongnu.org/patch/download.php?file_id=12381>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?5846>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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