diff options
author | Ben Pfaff <blp@ovn.org> | 2016-01-18 16:00:34 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-01-20 09:48:59 -0800 |
commit | 5876b4dbf6887a9c6c419c130a8ef9996ac52012 (patch) | |
tree | eebf6ea6998889d5ae23d855021fbdb395e14268 /lib/ofp-print.c | |
parent | 8fd0bb602e49bff8b5b6db594083572bb5604025 (diff) | |
download | openvswitch-5876b4dbf6887a9c6c419c130a8ef9996ac52012.tar.gz |
ofp-util: Fix OF1.4+ version of ofputil_decode_set_async_config().
The OF1.0 through OF1.3 "set async config" set the whole configuration,
OF1.4+ only update parts of it piecemeal, but the decoding function always
set the whole configuration. This commit fixes the problem by changing the
interface to require the caller to provide an initial state. (It would
be possible to simply make it mutate existing state in-place, but that
interface seems a little more error-prone.)
Found by inspection.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'lib/ofp-print.c')
-rw-r--r-- | lib/ofp-print.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ofp-print.c b/lib/ofp-print.c index accde8ed0..f36335bb7 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -2130,9 +2130,12 @@ ofp_print_nxt_set_async_config(struct ds *string, } } else if (raw == OFPRAW_OFPT14_SET_ASYNC || raw == OFPRAW_OFPT14_GET_ASYNC_REPLY) { - struct ofputil_async_cfg ac = OFPUTIL_ASYNC_CFG_INIT; + struct ofputil_async_cfg basis = OFPUTIL_ASYNC_CFG_INIT; + struct ofputil_async_cfg ac; + bool is_reply = raw == OFPRAW_OFPT14_GET_ASYNC_REPLY; - enum ofperr error = ofputil_decode_set_async_config(oh, is_reply, &ac); + enum ofperr error = ofputil_decode_set_async_config(oh, is_reply, + &basis, &ac); if (error) { ofp_print_error(string, error); return; |