mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
Better abstract OFPT_SET_CONFIG and OFPT_GET_CONFIG_REPLY, make stricter.
The OFPT_SET_CONFIG and OFPT_GET_CONFIG_REPLY messages, which have the same format, have a 'flags' field in which OpenFlow defines some bits, which change somewhat from one version to another, and does not define others. Until now, Open vSwitch has not abstracted these messages at all and has ignored the bits that OpenFlow leaves undefined. This commit abstracts the messages in the same way as other OpenFlow messages and validates in OFPT_SET_CONFIG messages that the undefined bits are set to zero. OpenFlow 1.1 and 1.2, but not OpenFlow 1.0, define a flag named OFPC_INVALID_TTL_TO_CONTROLLER. Open vSwitch has until now also implemented this as an extension to OpenFlow 1.0, and this commit retains that extension. Reported-by: Manpreet Singh <er.manpreet25@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
This commit is contained in:
@@ -461,7 +461,6 @@ static void
|
||||
send_features_request(struct lswitch *sw)
|
||||
{
|
||||
struct ofpbuf *b;
|
||||
struct ofp_switch_config *osc;
|
||||
int ofp_version = rconn_get_version(sw->rconn);
|
||||
|
||||
ovs_assert(ofp_version > 0 && ofp_version < 0xff);
|
||||
@@ -471,10 +470,10 @@ send_features_request(struct lswitch *sw)
|
||||
queue_tx(sw, b);
|
||||
|
||||
/* Send OFPT_SET_CONFIG. */
|
||||
b = ofpraw_alloc(OFPRAW_OFPT_SET_CONFIG, ofp_version, sizeof *osc);
|
||||
osc = ofpbuf_put_zeros(b, sizeof *osc);
|
||||
osc->miss_send_len = htons(OFP_DEFAULT_MISS_SEND_LEN);
|
||||
queue_tx(sw, b);
|
||||
struct ofputil_switch_config config = {
|
||||
.miss_send_len = OFP_DEFAULT_MISS_SEND_LEN
|
||||
};
|
||||
queue_tx(sw, ofputil_encode_set_config(&config, ofp_version));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user