static uint16_t
str_to_port_no(const char *vconn_name, const char *port_name)
{
- unsigned int port_no;
-
- if (str_to_uint(port_name, 10, &port_no)) {
+ uint16_t port_no = ofputil_port_from_string(port_name);
+ if (port_no) {
return port_no;
} else {
struct ofputil_phy_port pp;
parse_ofpacts(argv[3], &ofpacts);
po.buffer_id = UINT32_MAX;
- po.in_port = (!strcasecmp(argv[2], "none") ? OFPP_NONE
- : !strcasecmp(argv[2], "local") ? OFPP_LOCAL
- : str_to_port_no(argv[1], argv[2]));
+ po.in_port = str_to_port_no(argv[1], argv[2]);
po.ofpacts = ofpacts.data;
po.ofpacts_len = ofpacts.size;
struct ofputil_flow_mod fm;
struct ofpbuf *ofm;
- fm.match = fte->rule.match;
+ minimatch_expand(&fte->rule.match, &fm.match);
fm.priority = fte->rule.priority;
fm.cookie = htonll(0);
fm.cookie_mask = htonll(0);