Isn't 
```c
while(csum >> 16)
      csum = (csum >> 16) + (csum & 0xffff);
```
something different than 
```c
   csum = (csum >> 16) + (csum & 0xffff);
   csum += (csum >> 16);
```
assuming *csum* is > 2*16?