this should be in terms of a sockaddr_storage, not a uint32_t, so that it works for ipv6 and whatever else comes along. it should probably also return an error if !is_up()?