ofputil_parse_key_value() is safe to use from a process that must not abort
except in one case: where the argument contains unbalanced parentheses.
This commit eliminates that call to ovs_fatal(), instead just treating the
end of the string as closing all nested parentheses.
It would be better to propagate the error condition upward, but I'm not
sure that it's worth it just for this one corner case.
The purpose of this commit is to make it possible to use this function
indirectly within the "ofproto/trace" implementation, which must never
abort ovs-vswitchd. (All the current callers are within ovs-ofctl and
other utilities.)
Signed-off-by: Ben Pfaff <blp@nicira.com>
for (value_len = 0; level > 0; value_len++) {
switch (value[value_len]) {
case '\0':
- ovs_fatal(0, "unbalanced parentheses in argument to %s", key);
+ level = 0;
+ break;
case '(':
level++;