Hey there,
I am trying to figure out how to calculate the [ICMPv6 checksum](https://tools.ietf.org/html/rfc4443#section-2.3).

Let's assume I have an IPv6 packet like this:

Source IP: fe 80 00 00 00 00 00 00 be ae c5 ff fe df 31 d1

Destination IP: ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 01

Payload length: 00 18

Next header: 3a

ICMPv6: 80 00 00 c8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

What I am doing wrong when performing this calculation:
sum of:
fe80
0
0
0
beae
c5ff
fedf
31d1
ff02
0
0
0
0
0
0
1
18
3a
8000
now moving the bytes and adding them to the end

Code:
sum += sum >> 16;
result now is 3337
inverting the value

Code:
sum = ~sum;
result is c800
wireshark says it should be ccc8

I can't find the mistake here, can anyone please take a look at it?
Thanks and have a nice day!

Here is the wireshark screenshot:
http://i.imgur.com/Y7HaDZS.jpg