buglwIP - A Lightweight TCP/IP stack - Bugs: bug #42998, The netif hardware adddress length...

 
 

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

bug #42998: The netif hardware adddress length need to be changed.

Submitter:  任海波 <hichard>
Submitted:  Sat 16 Aug 2014 06:11:30 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Change Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Tue 19 Aug 2014 02:09:21 PM UTC, comment #2: 

CVS Head is not valid any more -> git head

OP: You're right in that NETIF_MAX_HWADDR_LEN cannot be changed right now, which seems odd.

-> made it overridable

Simon Goldschmidt <goldsimon>
Group administrator
Sat 16 Aug 2014 05:54:42 PM UTC, comment #1: 

lwIP is a TCP/IP stack, it does not care about how you put your IP datagrams on your medium. As long as YOU write the proper driver for YOUR desired physical+data-link layers, it will work over anything.
However, since some internal structures need a clue on how many bytes to hold for your physical address,

that specific macro is FOR YOU TO CONFIGURE.

That is why it can be set on lwipopts.h, which happens to be YOUR configuration file for lwIP (and you are welcome and EXPECTED to change it at your entire will), or opt.h, the general configuration file. Both are read by all other files in the project, including nd6.h


Sergio R. Caprile <scaprile>
Sat 16 Aug 2014 06:11:30 AM UTC, original submission:  

Hello:
     I have used lwip IPv6 for a long time. I find some problem which strongly recommended to make modification.
     Some code in the file netif.h as follow:
/** must be the maximum of all used hardware address lengths
    across all types of interfaces in use */
#define NETIF_MAX_HWADDR_LEN 6U
    This macro definition may be defined in the file opt.h and lwipopts.h. Why? Recently, I use lwip IPv6 to IEEE 802.15.4. In Ieee 802.15.4, the MAC Address is 8 byte length. First, I try to use the 802.15.4 as Virtual Ethernet, But it can't comuniticate with contiki. Contiki is a OS for IEEE 802.15.4 using for 6lowpan. This is because Neighbor discovery protocol not compatible.
    Modification the NETIF_MAX_HWADDR_LEN for a configurition can let lwip to support ieee 802.15.4.
   The follow code in the file nd6.h.
PACK_STRUCT_BEGIN
struct lladdr_option {
  PACK_STRUCT_FIELD(u8_t type);
  PACK_STRUCT_FIELD(u8_t length);
  PACK_STRUCT_FIELD(u8_t addr[NETIF_MAX_HWADDR_LEN]);
} PACK_STRUCT_STRUCT;
PACK_STRUCT_END
#ifdef PACK_STRUCT_USE_INCLUDES
#  include "arch/epstruct.h"
#endif
The code in nd6.c which is relevant to struct lladdr_option also need to be changed. Because the length in struct lladdr_option may be variable.


任海波 <hichard>

 

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

No files currently attached

 

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 hichard (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-08-19 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code