buglwIP - A Lightweight TCP/IP stack - Bugs: bug #16377, MEM_ALIGN and MEM_ALIGN_SIZE


You are not allowed to post comments on this tracker with your current authentication level.

bug #16377: MEM_ALIGN and MEM_ALIGN_SIZE

Submitted by:  None
Submitted on:  Wed 19 Apr 2006 01:59:02 AM UTC  
Category:  pbufs Severity:  2 - Minor
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Jonathan Larmour <jifl>
Open/Closed:  Closed Planned Release:  None
lwIP version:  None

( Jump to the original submission)

Tue 27 Feb 2007 04:50:50 PM UTC, comment #7: 

Assert now included. Closing...

Jonathan Larmour <jifl>
Project MemberIn charge of this item.
Tue 27 Feb 2007 04:45:48 PM UTC, comment #6: 

By all means.  Assigning to you.

Kieran Mansley <kieranm>
Project Member
Tue 27 Feb 2007 04:37:10 PM UTC, comment #5: 

Shall I check in the patch in comment #2 then?

Jonathan Larmour <jifl>
Project MemberIn charge of this item.
Mon 26 Feb 2007 02:35:12 PM UTC, comment #4: 

OK.  Will add an assertion to that effect.

Kieran Mansley <kieranm>
Project Member
Mon 26 Feb 2007 02:27:54 PM UTC, comment #3: 

I forgot to say that I don't have perms to reopen this bug, so even if you don't like my suggestion, please don't forget to reopen it because no-one will notice if it's closed :).

Jonathan Larmour <jifl>
Project MemberIn charge of this item.
Mon 26 Feb 2007 02:26:06 PM UTC, comment #2: 

I think the poster may be thinking about the case of PBUF_POOL_BUFSIZE leading to an unaligned address for each pbuf (other than the first, which is set as pbuf_pool with a MEM_ALIGN). That would cause real problems.

Perhaps a better "solution" for that would be an assert in pbuf_init to ensure that PBUF_POOL_BUFSIZE is a multiple of the alignment.

(file #12042)

Jonathan Larmour <jifl>
Project MemberIn charge of this item.
Mon 26 Feb 2007 01:05:58 PM UTC, comment #1: 

I'm not sure that would result in the correct value being computed.

Kieran Mansley <kieranm>
Project Member
Wed 19 Apr 2006 01:59:02 AM UTC, original submission:  

Is it good to change the code "p->next = (struct pbuf )((u8_t )p + PBUF_POOL_BUFSIZE + sizeof(struct pbuf));" within the function "pbuf_init" to "p->next = (struct pbuf )((u8_t )p + MEM_ALIGN_SIZE(PBUF_POOL_BUFSIZE + sizeof(struct pbuf))); "

to change the code "p->payload = (void )((u8_t )p + sizeof(struct pbuf)); " within the function "pbuf_free" to "p->payload = MEM_ALIGN((void )((u8_t )p + sizeof(struct pbuf)));



Attached Files
file #12042:  lwip.pbuf.aligncheck.patch.txt added by jifl (757B - text/plain - Check alignment in pbuf_init)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jifl (Updated the item)
  • -email is unavailable- added by kieranm (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-02-27 jifl StatusNone => Fixed
        Open/ClosedOpen => Closed
    2007-02-27 kieranm Assigned tokieranm => jifl
    2007-02-26 kieranm Severity3 - Normal => 2 - Minor
        StatusInvalid => None
        Assigned toNone => kieranm
        Open/ClosedClosed => Open
    2007-02-26 jifl Attached File- => Added lwip.pbuf.aligncheck.patch.txt, #12042
    2007-02-26 kieranm StatusNone => Invalid
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5