mirror of
https://github.com/openvswitch/ovs
synced 2025-10-23 14:57:06 +00:00
learn: Improve error reporting.
parse_int_string() returns an error if the field overflows, not if there is a bad hex digit. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc.
|
||||
* Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -197,7 +197,7 @@ learn_parse_load_immediate(const char *s, struct ofpact_learn_spec *spec)
|
||||
|
||||
err = parse_int_string(s, imm.u8, sizeof imm.u8, (char **) &s);
|
||||
if (err) {
|
||||
return xasprintf("%s: bad hex digit in value", full_s);
|
||||
return xasprintf("%s: too many bits in immediate value", full_s);
|
||||
}
|
||||
|
||||
if (strncmp(s, "->", 2)) {
|
||||
|
||||
Reference in New Issue
Block a user