TomMD/network-data — pull request #4 by akamaus (2013-08-29 08:05:18+00:00)
Title: fixed wrong order of fragmentation bit flags in fragmentOffset field of IPv4 header

Hi Tom! Looks like there was an error in serializing the flags field:
according to RFC791

Flags: 3 bits

Various Control Flags.

Bit 0: reserved, must be zero
Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment.
Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.

0 1 2
+---+---+---+
| | D | M |
| 0 | F | F |
+---+---+---+

These are highest bits of fragmentOffset field, so if you're moving all the triplet 13 bits left, MF should be 1, DF - 2 and Res - 4.

Hope I did it right.
Thanks for such a helpful package, BTW! It's great for testing my C networking code with QuickCheck ;)