X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fbundle.c;h=b68ebab8313fbea59159c4318ce117b668923974;hb=56de7118d0909425d714457f0cb470d69f069421;hp=e0f8e6b6c2e864dafa900080a8e3ed267ddfd861;hpb=21f045ac7eb2ecdd3bab919c9fc9ebb7dde84dd7;p=openvswitch diff --git a/lib/bundle.c b/lib/bundle.c index e0f8e6b6..b68ebab8 100644 --- a/lib/bundle.c +++ b/lib/bundle.c @@ -267,12 +267,15 @@ bundle_parse__(const char *s, char **save_ptr, uint16_t slave_port; char *slave; - slave = strtok_r(NULL, ", [", save_ptr); + slave = strtok_r(NULL, ", []", save_ptr); if (!slave || bundle->n_slaves >= BUNDLE_MAX_SLAVES) { break; } - slave_port = atoi(slave); + slave_port = ofputil_port_from_string(slave); + if (!slave_port) { + ovs_fatal(0, "%s: bad port number", slave); + } ofpbuf_put(ofpacts, &slave_port, sizeof slave_port); bundle = ofpacts->l2; @@ -387,7 +390,7 @@ bundle_format(const struct ofpact_bundle *bundle, struct ds *s) ds_put_cstr(s, ","); } - ds_put_format(s, "%"PRIu16, bundle->slaves[i]); + ofputil_format_port(bundle->slaves[i], s); } ds_put_cstr(s, ")");