linux-kernelorg-stable/tools
Jakub Kicinski 9738280aae tools: ynl: fix mixing ops and notifications on one socket
The multi message support loosened the connection between the request
and response handling, as we can now submit multiple requests before
we start processing responses. Passing the attr set to NlMsgs decoding
no longer makes sense (if it ever did), attr set may differ message
by messsage. Isolate the part of decoding responsible for attr-set
specific interpretation and call it once we identified the correct op.

Without this fix performing SET operation on an ethtool socket, while
being subscribed to notifications causes:

 # File "tools/net/ynl/pyynl/lib/ynl.py", line 1096, in _op
 # Exception|     return self._ops(ops)[0]
 # Exception|            ~~~~~~~~~^^^^^
 # File "tools/net/ynl/pyynl/lib/ynl.py", line 1040, in _ops
 # Exception|     nms = NlMsgs(reply, attr_space=op.attr_set)
 # Exception|                                    ^^^^^^^^^^^

The value of op we use on line 1040 is stale, it comes form the previous
loop. If a notification comes before a response we will update op to None
and the next iteration thru the loop will break with the trace above.

Fixes: 6fda63c45f ("tools/net/ynl: fix cli.py --subscribe feature")
Fixes: ba8be00f68 ("tools/net/ynl: Add multi message support to ynl")
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://patch.msgid.link/20250618171746.1201403-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-06-19 08:37:39 -07:00
..
accounting
arch perf tools improvements and fixes for Linux v6.16: 2025-06-03 15:11:44 -07:00
bootconfig tools/bootconfig: specify LDFLAGS as an argument to CC 2025-05-16 11:22:54 +09:00
bpf tools/resolve_btfids: Fix build when cross compiling kernel with clang. 2025-06-10 09:09:27 -07:00
build
certs
cgroup
counter
crypto
debugging
firewire
firmware
gpio
hv tools: hv: Enable debug logs for hv_kvp_daemon 2025-05-23 16:30:55 +00:00
iio
include Including fixes from CAN, wireless, Bluetooth, and Netfilter. 2025-06-05 12:34:55 -07:00
kvm/kvm_stat
laptop
leds
lib libbpf: Handle unsupported mmap-based /sys/kernel/btf/vmlinux correctly 2025-06-06 14:07:07 -07:00
memory-model
mm
net tools: ynl: fix mixing ops and notifications on one socket 2025-06-19 08:37:39 -07:00
objtool Rust changes for v6.16 2025-06-04 21:18:37 -07:00
pcmcia
perf RISC-V Patches for the 6.16 Merge Window, Part 1 2025-06-06 18:05:18 -07:00
power turbostat v2025.06.08 2025-06-08 11:44:41 -07:00
rcu
sched_ext
scripts
sound
spi
testing selftests: net: add test for passive TFO socket NAPI ID 2025-06-18 18:30:51 -07:00
thermal
time
tracing tracing tools updates for v6.16: 2025-05-29 20:59:52 -07:00
usb
verification
virtio
wmi
workqueue
writeback
Makefile