Commit 976b90c2 authored by Jelle De Vleeschouwer's avatar Jelle De Vleeschouwer

[6LoWPAN] - fix endianness for fragment tags

parent 760c1bb9
......@@ -1271,8 +1271,8 @@ frag_fill(uint8_t *frag, uint8_t dispatch, uint16_t dgram_size, uint16_t tag, ui
{
frag[0] = (uint8_t)(dispatch | ((uint8_t)short_be(dgram_size) & 0x07));
frag[1] = (uint8_t)(short_be(dgram_size) >> 8);
frag[2] = (uint8_t)(tag);
frag[3] = (uint8_t)(tag >> 8);
frag[2] = (uint8_t)(short_be(tag));
frag[3] = (uint8_t)(short_be(tag) >> 8);
frag[4] = (uint8_t)(dgram_off);
buf_move(frag + offset, buf + copied, copy);
}
......@@ -1565,7 +1565,6 @@ defrag_remove_header(struct pico_frame *f, uint16_t *dgram_size, uint16_t *tag,
*dgram_size = (uint16_t)(((uint16_t)(f->net_hdr[0] & 0x07) << 8) | (uint16_t)f->net_hdr[1]);
*tag = (uint16_t)(((uint16_t)f->net_hdr[2] << 8) | (uint16_t)f->net_hdr[3]);
*off = (uint16_t)((uint16_t)f->net_hdr[4] << 3);
dbg("RECV [0]: %02X [1]: %02X dgram_size: %d off: %d tag: %d\n", f->net_hdr[0], f->net_hdr[1], *dgram_size, *off, *tag);
f->net_len = (uint16_t)(f->net_len - (uint16_t)size);
f->len = (uint32_t)(f->len - (uint32_t)size);
f->net_hdr += size;
......
......@@ -57,7 +57,7 @@ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
sleep 1
(build/test/picoapp6.elf -6 1,2,1 -a udpecho,::0,6667,) &
sleep 1
build/test/picoapp6.elf -6 2,1,0 -a udpclient,2aaa:abcd:0000:0000:0200:00aa:ab00:0001,6667,6667,1400,100,10, || exit 1
build/test/picoapp6.elf -6 2,1,0 -a udpclient,2aaa:abcd:0000:0000:0200:00aa:ab00:0001,6667,6667,1400,10,1, || exit 1
killall -w picoapp6.elf -s SIGQUIT
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment