ipv4: deduplicate socket option code

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