patchlwIP - A Lightweight TCP/IP stack - Patches: patch #8160, Simplify...

 
 

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

patch #8160: Simplify ip6_addr_set_solicitednode() and ip6_addr_cmp_solicitednode().

Submitter:  Valery Ushakov <uwe>
Submitted:  Thu 15 Aug 2013 12:48:44 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Fri 17 Jan 2014 09:06:11 PM UTC, comment #1: 

Done, thanks.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 15 Aug 2013 12:48:44 AM UTC, original submission:  

It is not necessary to htonl back and forth just to perform bitwise ops is host byte-order; and since the value OR'ed in is all ones, there's no need to mask those bits in the original value first.

Thus "set" can be simplified from


(ip6addr)->addr[3] = htonl(0xff000000UL | (htonl(if_id) & 0x00ffffffUL));


to just


(ip6addr)->addr[3] = (PP_HTONL(0xff000000UL) | (if_id));


Valery Ushakov <uwe>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #28845:  ip6_addr.h.diff added by uwe (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by uwe (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-17 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2013-08-15 uwe Attached File- Added ip6_addr.h.diff, #28845

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code