ipv4: fix potential misaligned memory access

Also makes use of encoding/binary package.

Change-Id: Id41ea874487f88a3de9fa28b613a77eb66643cc8
Reviewed-on: https://go-review.googlesource.com/19534
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2 files changed