When the RSTP implementation sent BPDUs, it failed to initialize some of their bytes. None of the code initialized an array of 7 padding bytes, and some of it also failed to initialize the version1_length field. In addition, the padding bytes confused some implementations that did not correctly ignore extra bytes.
This commit fixes both problems, by removing the padding bytes and initializing every byte in outgoing messages. Reported-by: David van Moolenbroek <[email protected]> Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-June/046864.html Signed-off-by: Ben Pfaff <[email protected]> --- AUTHORS.rst | 1 + lib/rstp-common.h | 1 - lib/rstp-state-machines.c | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 9c81ad8b5d2d..1166a12820eb 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -430,6 +430,7 @@ Darragh O'Reilly [email protected] Dave Walker [email protected] David Evans [email protected] David Palma [email protected] +David van Moolenbroek [email protected] Derek Cormier [email protected] Dhaval Badiani [email protected] DK Moon [email protected] diff --git a/lib/rstp-common.h b/lib/rstp-common.h index c1082323ca18..7948842f4d3a 100644 --- a/lib/rstp-common.h +++ b/lib/rstp-common.h @@ -238,7 +238,6 @@ struct rstp_bpdu { ovs_be16 hello_time; ovs_be16 forward_delay; uint8_t version1_length; - uint8_t padding[7]; }); enum rstp_info_is { diff --git a/lib/rstp-state-machines.c b/lib/rstp-state-machines.c index 7d677d7a2401..7bd1f80c41a6 100644 --- a/lib/rstp-state-machines.c +++ b/lib/rstp-state-machines.c @@ -838,6 +838,7 @@ tx_config(struct rstp_port *p) { struct rstp_bpdu bpdu; + memset(&bpdu, 0, sizeof bpdu); bpdu.protocol_identifier = htons(0); bpdu.protocol_version_identifier = 0; bpdu.bpdu_type = CONFIGURATION_BPDU; @@ -868,6 +869,7 @@ tx_rstp(struct rstp_port *p) { struct rstp_bpdu bpdu; + memset(&bpdu, 0, sizeof bpdu); bpdu.protocol_identifier = htons(0); bpdu.protocol_version_identifier = 2; bpdu.bpdu_type = RAPID_SPANNING_TREE_BPDU; -- 2.16.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
