[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #8160] Simplify ip6_addr_set_solicitednode() and ip6
From: |
Valery Ushakov |
Subject: |
[lwip-devel] [patch #8160] Simplify ip6_addr_set_solicitednode() and ip6_addr_cmp_solicitednode(). |
Date: |
Thu, 15 Aug 2013 00:48:45 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0 |
URL:
<http://savannah.nongnu.org/patch/?8160>
Summary: Simplify ip6_addr_set_solicitednode() and
ip6_addr_cmp_solicitednode().
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: uwe
Submitted on: Thu 15 Aug 2013 12:48:44 AM GMT
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
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));
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 15 Aug 2013 12:48:44 AM GMT Name: ip6_addr.h.diff Size: 1kB By:
uwe
<http://savannah.nongnu.org/patch/download.php?file_id=28845>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?8160>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [patch #8160] Simplify ip6_addr_set_solicitednode() and ip6_addr_cmp_solicitednode().,
Valery Ushakov <=