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: pbufsSeverity: 2 - Minor
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Jonathan Larmour <jifl>
Open/Closed: ClosedPlanned Release: None
lwIP version: None

(Jump to the original submission 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 Administrator
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 Administrator
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 Administrator
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)));
"

Anonymous

 

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
  • -unavailable- added by jifl (Updated the item)
  • -unavailable- added by kieranm (Posted a comment)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 27 Feb 2007 04:50:50 PM UTCjiflStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 27 Feb 2007 04:45:48 PM UTCkieranmAssigned tokieranm=>jifl
    Mon 26 Feb 2007 02:35:12 PM UTCkieranmSeverity3 - Normal=>2 - Minor
      StatusInvalid=>None
      Assigned toNone=>kieranm
      Open/ClosedClosed=>Open
    Mon 26 Feb 2007 02:26:06 PM UTCjiflAttached File-=>Added lwip.pbuf.aligncheck.patch.txt, #12042
    Mon 26 Feb 2007 01:05:58 PM UTCkieranmStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1