X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fautopath.c;h=b204e847307230ae72a19eb747ced40ad741963d;hb=c6100d92142bc3dd325180cb4e10553eb4341731;hp=ae8007dee0f82c45204dd04caaa06400313647e4;hpb=2ac3c572267c550302eee88d4f584b3694d88f88;p=sliver-openvswitch.git diff --git a/lib/autopath.c b/lib/autopath.c index ae8007dee..b204e8473 100644 --- a/lib/autopath.c +++ b/lib/autopath.c @@ -36,7 +36,6 @@ void autopath_parse(struct ofpact_autopath *ap, const char *s_) { char *s; - int id_int; char *id_str, *dst, *save_ptr; ofpact_init_AUTOPATH(ap); @@ -50,12 +49,10 @@ autopath_parse(struct ofpact_autopath *ap, const char *s_) ovs_fatal(0, "%s: not enough arguments to autopath action", s_); } - id_int = atoi(id_str); - if (id_int < 1 || id_int > UINT32_MAX) { - ovs_fatal(0, "%s: autopath id %d is not in valid range " - "1 to %"PRIu32, s_, id_int, UINT32_MAX); + ap->port = ofputil_port_from_string(id_str); + if (!ap->port) { + ovs_fatal(0, "%s: bad port number", s_); } - ap->port = id_int; mf_parse_subfield(&ap->dst, dst); if (ap->dst.n_bits < 16) {