Commit bc7c58f
Hangbin Liu
tools/net/ynl: ethtool: fix crash when Hardware Clock info is missing
JIRA: https://issues.redhat.com/browse/RHEL-78772
Upstream Status: net.git commit 4537581
commit 4537581
Author: Hangbin Liu <liuhangbin@gmail.com>
Date: Thu May 8 03:54:14 2025 +0000
tools/net/ynl: ethtool: fix crash when Hardware Clock info is missing
Fix a crash in the ethtool YNL implementation when Hardware Clock information
is not present in the response. This ensures graceful handling of devices or
drivers that do not provide this optional field. e.g.
Traceback (most recent call last):
File "/net/tools/net/ynl/pyynl/./ethtool.py", line 438, in <module>
main()
~~~~^^
File "/net/tools/net/ynl/pyynl/./ethtool.py", line 341, in main
print(f'PTP Hardware Clock: {tsinfo["phc-index"]}')
~~~~~~^^^^^^^^^^^^^
KeyError: 'phc-index'
Fixes: f3d07b0 ("tools: ynl: ethtool testing tool")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250508035414.82974-1-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Hangbin Liu <haliu@redhat.com>1 parent 82f03bd commit bc7c58f
1 file changed
+15
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | | - | |
344 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
345 | 354 | | |
346 | | - | |
347 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
348 | 358 | | |
349 | | - | |
350 | | - | |
351 | 359 | | |
352 | 360 | | |
353 | 361 | | |
| |||
0 commit comments