ofp-errors: Make every error encodable.
authorBen Pfaff <blp@nicira.com>
Sat, 1 Dec 2012 00:22:52 +0000 (16:22 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 4 Dec 2012 16:25:56 +0000 (08:25 -0800)
commit07c8ec217b5641b74f20b216ad63fef230649f2c
treeb73bc3dc5863dce4b113a998d9a58cd41800cfcf
parentdf30f9b1cde861e157059d225f46e16826fe13c0
ofp-errors: Make every error encodable.

Until now, some values could not be encoded to send over OpenFlow, for a
few possible reasons.  This meant that, when one of these situations came
up, that a controller would not receive any notification that its request
failed.  This is not a good way to behave, so this commit changes the
error encoder so that, if a particular error cannot be encoded, it will
instead encode a fallback error code.

This commit also slightly simplifies ofconn_send_error() because it no
longer has to handle ofperr_encode_error() returning NULL.

Reported-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-errors.c
lib/ofp-errors.h
ofproto/connmgr.c