Re: 6lowpan raw socket problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It looks like in 6lowpan_iphc.c lowpan_header_compress the original ipv6 header is removed and the compressed header is attached.

These four lines are responsible.
    skb_pull(skb, sizeof(struct ipv6hdr));
    skb_reset_transport_header(skb);
    memcpy(skb_push(skb, hc06_ptr - head), head, hc06_ptr - head);
    skb_reset_network_header(skb);

I don't think we can do this as the skb is being used in other parts of the ip stack. Hence when the ipv6 header is read elsewhere the addresses become corrupt as they have been overwritten by the 6lowpan compressed header.

Any ideas on how to fix this?

Simon

On 18/09/14 15:19, Alexander Aring wrote:
On Thu, Sep 18, 2014 at 03:02:17PM +0100, Simon Vincent wrote:
I have created a small test program that shows this problem. It looks like a
race condition as sometimes the addresses are not corrupt.

Mhh maybe some used after freed and then we copy somewhere garbage sometimes.
Don't know right now.

It looks like if the RAW socket gets the packet before the packet hits the
6lowpan layer the addresses are fine. If the packet hits the 6lowpan layer
before the RAW socket gets the packet then the addresses are corrupt.

The test program can be found here.
https://github.com/xsilon/sockdebug

I will continue debugging!

ok, good luck.

- Alex

--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux