lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #30402] CHECKSUM_GEN_IP_INLINE does not add IP options


From: Stephane Lesage
Subject: [lwip-devel] [bug #30402] CHECKSUM_GEN_IP_INLINE does not add IP options
Date: Wed, 21 Jul 2010 11:49:44 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Follow-up Comment #2, bug #30402 (project lwip):

Hi,

you restyled my patch

from

    u16_t* opt = (u16_t*)p->payload;
    for (i=0; i<optlen_aligned/2; i++) {
        chk_sum += *opt++;
    }
to
    for (i = 0; i < optlen_aligned; i += sizeof(u16_t)) { 
        chk_sum += ((u16_t*)p->payload)[i]; 
    } 

But this is wrong because you mix byte index in the loop counter and word
index in the array.

please fix with:

for (i = 0; i < optlen_aligned/2; i++) {
    chk_sum += ((u16_t*)p->payload)[i];
}


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/




reply via email to

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