2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00

ovs-save: Use right OpenFlow version for add-tlv-map.

When the bridge protocols is not included Openflow10, printing an error
message "version negotiation failed" when doing "Restoring saved flows".

Signed-off-by: Han Ding <handing@chinatelecom.cn>
Acked-by: Mike Pattrick <mkp@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Han Ding 2022-07-01 18:52:40 +08:00 committed by Ilya Maximets
parent b47ebf7186
commit 269a947c7b

View File

@ -127,7 +127,7 @@ save_flows () {
# Get the highest enabled OpenFlow version # Get the highest enabled OpenFlow version
ofp_version=$(get_highest_ofp_version "$bridge") ofp_version=$(get_highest_ofp_version "$bridge")
printf "%s" "ovs-ofctl add-tlv-map ${bridge} '" printf "%s" "ovs-ofctl -O $ofp_version add-tlv-map ${bridge} '"
ovs-ofctl dump-tlv-map ${bridge} -O $ofp_version | \ ovs-ofctl dump-tlv-map ${bridge} -O $ofp_version | \
awk '/^ *0x/ {if (cnt != 0) printf ","; \ awk '/^ *0x/ {if (cnt != 0) printf ","; \
cnt++;printf "{class="$1",type="$2",len="$3"}->"$4}' cnt++;printf "{class="$1",type="$2",len="$3"}->"$4}'