X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=utilities%2Fovs-ofctl.c;h=dea88787e2e4f7b76a695d639dbc633e213f9a8c;hb=c97a72ea2ed78ad87b471447e498f7e09c6f7c85;hp=2d982731d3a098005139c0823556255e6fc0feb5;hpb=48d28ac16112f72ef0985ec2d013425202af8f5c;p=sliver-openvswitch.git diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 2d982731d..dea88787e 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -741,9 +741,8 @@ fetch_ofputil_phy_port(const char *vconn_name, const char *port_name, 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; @@ -1466,9 +1465,7 @@ ofctl_packet_out(int argc, char *argv[]) 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; @@ -1969,7 +1966,7 @@ fte_make_flow_mod(const struct fte *fte, int index, uint16_t command, 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);