Skip to content

Commit 41eac17

Browse files
committed
parse:ovs: Ignore deprecated OpenFlow1.6 protocol (LP: #1963735)
The OpenFlow 1.6 draft got abandoned by the ONF as of OVS v2.12: https://www.openvswitch.org/releases/NEWS-2.12.0.txt
1 parent ef29604 commit 41eac17

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

doc/netplan-yaml.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Match devices by MAC when setting options like: `wakeonlan` or `*-offload`.
161161
> Valid for bridge interfaces or the network section. List of protocols to
162162
> be used when negotiating a connection with the controller. Accepts
163163
> `OpenFlow10`, `OpenFlow11`, `OpenFlow12`, `OpenFlow13`, `OpenFlow14`,
164-
> `OpenFlow15` and `OpenFlow16`.
164+
> and `OpenFlow15`.
165165

166166
- **rstp** (bool) – since **0.100**
167167

src/parse.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -2462,8 +2462,9 @@ handle_ovs_bridge_fail_mode(NetplanParser* npp, yaml_node_t* node, const void* d
24622462
static gboolean
24632463
handle_ovs_protocol(NetplanParser* npp, yaml_node_t* node, void* entryptr, const void* data, GError** error)
24642464
{
2465+
const char* deprecated[] = { "OpenFlow16" };
24652466
const char* supported[] = {
2466-
"OpenFlow10", "OpenFlow11", "OpenFlow12", "OpenFlow13", "OpenFlow14", "OpenFlow15", "OpenFlow16", NULL
2467+
"OpenFlow10", "OpenFlow11", "OpenFlow12", "OpenFlow13", "OpenFlow14", "OpenFlow15", NULL
24672468
};
24682469
unsigned i = 0;
24692470
guint offset = GPOINTER_TO_UINT(data);
@@ -2473,6 +2474,11 @@ handle_ovs_protocol(NetplanParser* npp, yaml_node_t* node, void* entryptr, const
24732474
yaml_node_t *entry = yaml_document_get_node(&npp->doc, *iter);
24742475
assert_type(npp, entry, YAML_SCALAR_NODE);
24752476

2477+
if (!g_strcmp0(scalar(entry), deprecated[0])) {
2478+
g_warning("openvswitch: Ignoring deprecated protocol: %s", scalar(entry));
2479+
continue;
2480+
}
2481+
24762482
for (i = 0; supported[i] != NULL; ++i)
24772483
if (!g_strcmp0(scalar(entry), supported[i]))
24782484
break;

tests/generator/test_ovs.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,14 @@ def test_global_external_ids_other_config(self):
122122
self.assert_networkd({'eth0.network': ND_DHCP4 % 'eth0'})
123123

124124
def test_global_set_protocols(self):
125-
self.generate('''network:
125+
out = self.generate('''network:
126126
version: 2
127127
openvswitch:
128-
protocols: [OpenFlow10, OpenFlow11, OpenFlow12]
128+
protocols: [OpenFlow10, OpenFlow11, OpenFlow12, OpenFlow16]
129129
bridges:
130130
ovs0:
131-
openvswitch: {}''')
131+
openvswitch: {}''', skip_generated_yaml_validation=True) # OpenFlow16 won't be re-generated
132+
self.assertIn('openvswitch: Ignoring deprecated protocol: OpenFlow16', out)
132133
self.assert_ovs({'ovs0.service': OVS_VIRTUAL % {'iface': 'ovs0', 'extra': '''
133134
[Service]
134135
Type=oneshot

0 commit comments

Comments
 (0)