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.

Submitted by:  任海波 <hichard>
Submitted on:  Sat 16 Aug 2014 06:11:30 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Change RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Aug 2014 02:09:21 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1