summaryrefslogtreecommitdiff
path: root/lib/ofp-util.c
diff options
context:
space:
mode:
authorJarno Rajahalme <jarno@ovn.org>2017-01-06 18:14:48 -0800
committerJarno Rajahalme <jarno@ovn.org>2017-01-06 18:14:48 -0800
commit8319a81a0acbce682f5f24c77cee8dd00ab7f02f (patch)
treedd25da32c602d5d036ebceb1b3b17d10ac11c1ab /lib/ofp-util.c
parent3d47fa466aea5173a236f826e438b2f4ece83b84 (diff)
downloadopenvswitch-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.c6
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