lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #57344] IS_SOCK_ADDR_ALIGNED(name) in sockets.c is 4-b


From: Victor Brzeski
Subject: [lwip-devel] [bug #57344] IS_SOCK_ADDR_ALIGNED(name) in sockets.c is 4-byte aligned, not aligned to MEM_ALIGNMENT
Date: Mon, 2 Dec 2019 14:00:18 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36

URL:
  <https://savannah.nongnu.org/bugs/?57344>

                 Summary: IS_SOCK_ADDR_ALIGNED(name) in sockets.c is 4-byte
aligned, not aligned to MEM_ALIGNMENT
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: vbrzeski
            Submitted on: Mon 02 Dec 2019 07:00:16 PM UTC
                Category: sockets/netconn
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

As suggested, the socket API in sockets.c has a macro to detect misaligned
socket addresses as so:

#define IS_SOCK_ADDR_ALIGNED(name) \
  ((((mem_ptr_t)(name)) % 4) == 0)

it seems it should be as so:

#define IS_SOCK_ADDR_ALIGNED(name) \
  ((((mem_ptr_t)(name)) % MEM_ALIGNMENT) == 0)

The effect is that my 16-bit system will not be able to allocate the sock addr
on a normal alignment for my architecture. While there are work-arounds with
arch.h, these induce tight-coupling to lwIP for my application code.






    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?57344>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

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