diff options
author | Jarno Rajahalme <jarno@ovn.org> | 2017-01-06 18:14:48 -0800 |
---|---|---|
committer | Jarno Rajahalme <jarno@ovn.org> | 2017-01-06 18:14:48 -0800 |
commit | 8319a81a0acbce682f5f24c77cee8dd00ab7f02f (patch) | |
tree | dd25da32c602d5d036ebceb1b3b17d10ac11c1ab /lib/ofp-util.c | |
parent | 3d47fa466aea5173a236f826e438b2f4ece83b84 (diff) | |
download | openvswitch-8319a81a0acbce682f5f24c77cee8dd00ab7f02f.tar.gz |
ofp-util: Do not assert fail if decoding malformed property.
OVS should not crash if the controller sends a malformed OpenFlow
message. Return the error code instead.
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/ofp-util.c')
-rw-r--r-- | lib/ofp-util.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 156d8d25c..e4f186de2 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -4061,7 +4061,9 @@ ofputil_decode_packet_in_private(const struct ofp_header *oh, bool loose, uint64_t type; error = ofpprop_pull(&continuation, &payload, &type); - ovs_assert(!error); + if (error) { + break; + } switch (type) { case NXCPT_BRIDGE: @@ -4124,7 +4126,7 @@ ofputil_decode_packet_in_private(const struct ofp_header *oh, bool loose, ofputil_packet_in_private_destroy(pin); } - return 0; + return error; } /* Frees data in 'pin' that is dynamically allocated by |