[PATCH v2] conf: Unify several paths in conf_ports()