Bug#1124763: trixie-pu: package python-os-ken/3.0.1-2
Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: python-os-ken@packages.debian.org
Control: affects -1 + src:python-os-ken
User: release.debian.org@packages.debian.org
Usertags: pu
Dear release team,
[ Reason ]
During production, we found out that in some cases, OpenStack Neutron's
openvswitch agent could crash. My colleague wrote the details here:
https://bugs.launchpad.net/neutron/+bug/2133487
This was then fixed upstream, and backported by upstream:
https://review.opendev.org/q/I9069337270cc261974c524a5ab284b055177ab3e
(note: the version in Trixie is 2025.1)
The impact may be very bad in production, with compute nodes not reacting
at all to network port creation / deletion / updates as neutron-ovs-agent
is in fact dead.
[ Impact ]
Without fixing os-ken, it's possible that neutron-openvswitch-agent main
thread just crashes, while the service still reports itself as running
(as it reports in another thread).
[ Tests ]
Extensive unit and functional test are done in upstream CI.
[ Risks ]
The patch is minimal and well tested, with a new test case. So risk is
minimal.
[ Checklist ]
[x] *all* changes are documented in the d/changelog
[x] I reviewed all changes and I approve them
[x] attach debdiff against the package in (old)stable
[x] the issue is verified as fixed in unstable
[ Changes ]
The function in os-ken that wasn't accepting None as value, now does, and
there is a new unit test for that.
Please allow me to upload python-os-ken_3.0.1-2+deb13u1 to Trixie p-u.
Cheers,
Thomas Goirand (zigo)
diff -Nru python-os-ken-3.0.1/debian/changelog python-os-ken-3.0.1/debian/changelog
--- python-os-ken-3.0.1/debian/changelog 2025-03-28 09:34:42.000000000 +0100
+++ python-os-ken-3.0.1/debian/changelog 2026-01-06 14:20:12.000000000 +0100
@@ -1,3 +1,9 @@
+python-os-ken (3.0.1-2+deb13u1) trixie; urgency=medium
+
+ * Add Accept_empty_OXM_fields.patch.
+
+ -- Thomas Goirand <zigo@debian.org> Tue, 06 Jan 2026 14:20:12 +0100
+
python-os-ken (3.0.1-2) unstable; urgency=medium
* Uploading to unstable.
diff -Nru python-os-ken-3.0.1/debian/patches/Accept_empty_OXM_fields.patch python-os-ken-3.0.1/debian/patches/Accept_empty_OXM_fields.patch
--- python-os-ken-3.0.1/debian/patches/Accept_empty_OXM_fields.patch 1970-01-01 01:00:00.000000000 +0100
+++ python-os-ken-3.0.1/debian/patches/Accept_empty_OXM_fields.patch 2026-01-06 14:20:12.000000000 +0100
@@ -0,0 +1,68 @@
+Description: Accept empty "OXM" fields (tuple, list)
+ When decoding an "OXM" field, now it is possible to accept
+ and empty tuple or list. The value and the mask are considered as
+ "None".
+Author: lajoskatona <lajos.katona@est.tech>
+Date: Wed, 10 Dec 2025 10:23:17 +0100
+Bug: https://launchpad.net/bugs/2133487
+Signed-off-by: lajoskatona <lajos.katona@est.tech>
+Co-Authored-By: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
+Change-Id: I9069337270cc261974c524a5ab284b055177ab3e
+Origin: upstream, https://review.opendev.org/c/openstack/os-ken/+/972086
+Last-Update: 2026-01-06
+
+diff --git a/os_ken/ofproto/oxx_fields.py b/os_ken/ofproto/oxx_fields.py
+index c37557f..84facd5 100644
+--- a/os_ken/ofproto/oxx_fields.py
++++ b/os_ken/ofproto/oxx_fields.py
+@@ -59,7 +59,10 @@
+ # the 'list' case below is a bit hack; json.dumps silently maps
+ # python tuples into json lists.
+ if oxx == 'oxm' and isinstance(user_value, (tuple, list)):
+- (value, mask) = user_value
++ if not user_value:
++ value, mask = None, None
++ else:
++ (value, mask) = user_value
+ else:
+ value = user_value
+ mask = None
+diff --git a/os_ken/tests/unit/ofproto/test_oxm.py b/os_ken/tests/unit/ofproto/test_oxm.py
+index 3a58ac9..1b00142 100644
+--- a/os_ken/tests/unit/ofproto/test_oxm.py
++++ b/os_ken/tests/unit/ofproto/test_oxm.py
+@@ -24,6 +24,8 @@
+ (f, uv) = user
+ (n, v, m) = ofp.oxm_from_user(f, uv)
+ buf = bytearray()
++ m = b'' if m is None else m
++ v = b'' if v is None else v
+ ofp.oxm_serialize(n, v, m, buf, 0)
+ self.assertEqual(on_wire, buf)
+
+@@ -46,9 +48,10 @@
+ f = ofp.oxm_to_user_header(n)
+ self.assertEqual(user, f)
+
+- def _test(self, user, on_wire, header_bytes):
++ def _test(self, user, on_wire, header_bytes, test_decode=True):
+ self._test_encode(user, on_wire)
+- self._test_decode(user, on_wire)
++ if test_decode:
++ self._test_decode(user, on_wire)
+ if isinstance(user[1], tuple): # has mask?
+ return
+ user_header = user[0]
+@@ -186,3 +189,12 @@
+ b'fugafuga'
+ )
+ self._test(user, on_wire, 4)
++
++ def test_empty_values(self):
++ # This test is a corner case that rarely happens. The decoded
++ # information is empty.
++ user = ('ipv4_src', ())
++ on_wire = (
++ b'\x80\x00\x16\x00'
++ )
++ self._test(user, on_wire, 4, test_decode=False)
diff -Nru python-os-ken-3.0.1/debian/patches/series python-os-ken-3.0.1/debian/patches/series
--- python-os-ken-3.0.1/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ python-os-ken-3.0.1/debian/patches/series 2026-01-06 14:20:12.000000000 +0100
@@ -0,0 +1 @@
+Accept_empty_OXM_fields.patch
Reply to: