Bug in sixlowpan/lrwpan

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Bug in sixlowpan/lrwpan

Tommaso Pecorella
Hi Tom,

I found a bug in how IP addresses are assigned to 6LoWPAN devices. Basically it doesn’t take into account the PanId, while it should be PanId:00:00:NodeId (in case of short addresses).

I could fix it in 6LoWPAN, but it’s cumbersome, and it would add a “hard” dependency on the lrwpan module.

Fixing it in lrwpan is way easier, but then I found another problem - 6LoWPAN implicitly assumes that the address is a short one, because it’s using the NetDevice::GetAddress, that returns an address using the short address.

Anyway, the fix I had in mind involves:
1) add the following functions to lrwpan NetDevice: GetPanId, GetShortAddress.
2) have GetAddress return either the Mac64 if not associated to a pan or a Mac48 pseudoaddress based on PanId and NodeId - this following the RFC.
3) add a traced callback function in lrwpan to signal when the association has been done, and have sixlowpan listening.

The last step is needed to prevent that an early Ipv6Interface creation would use the wrong address. This is a different bug... but it’s there nonetheless.

As a side note, I’m coding some stuff and I’ll have to change some implementation details in IPv6. Nothing involving interfaces. Code review soon (hopefully)



Sent from my iPhone