[PATCH v2 01/28] Clean up parsing of port ranges