support IPv6 in OFConnectionManager

Reviewer: @kenchiang

This pull request refactors a few places that need to handle different protocol
types, then adds IPv6 support. I tested this manually by connecting to a
controller using loopback and link-local addresses.
Fixed.