From: Daisuke Kotani Date: Mon, 23 Dec 2013 09:19:48 +0000 (+0900) Subject: ofp-parse: Check port number only after parsing it in parse_output(). X-Git-Tag: sliver-openvswitch-2.1.90-1~10^2~75 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2918176868f0b12eb8e705638c50befd69ac2f4b;p=sliver-openvswitch.git ofp-parse: Check port number only after parsing it in parse_output(). This patch allows to set max_len to UINT16_MAX in parse_output if output port is OFPP_CONTROLLER. Signed-off-by: Daisuke Kotani Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 6b69ecd8e..251adfac8 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -212,10 +212,10 @@ parse_output(const char *arg, struct ofpbuf *ofpacts) struct ofpact_output *output; output = ofpact_put_OUTPUT(ofpacts); - output->max_len = output->port == OFPP_CONTROLLER ? UINT16_MAX : 0; if (!ofputil_port_from_string(arg, &output->port)) { return xasprintf("%s: output to unknown port", arg); } + output->max_len = output->port == OFPP_CONTROLLER ? UINT16_MAX : 0; return NULL; } }