チケット #44750

generate_packets.py: erroneous output when some (but not all) variants of a packet have no fields

登録: 2022-06-04 06:12 最終更新: 2022-06-08 20:21

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
1

詳細

Packets with no fields are handled differently from packets with fields. Some code in generate_packets.py only looks at a variant's fields to determine whether this is the case, so if a packet has fields, but one of its variants does not, that causes problems. This happens when all fields of a packet are add-cap or remove-cap, and no capability is used for both.

As far as I can tell, if this ever occurs in practice, the resulting code will not compile, so it won't result in sneaky issues that remain undetected and actually get committed.

チケットの履歴 (5 件中 3 件表示)

2022-06-04 06:12 更新者: alienvalkyrie
  • 新しいチケット "generate_packets.py: erroneous output when some (but not all) variants of a packet have no fields" が作成されました
2022-06-04 07:04 更新者: alienvalkyrie
  • 詳細が更新されました
コメント

The simple-seeming solution (doing stuff based on Packet.no_packet rather than Variant.fields) unfortunately leads to code that still doesn't compile (in debug mode at least) – the lack of a __dummy field means nothing is written to the packet struct in the receive handler, which gives "potentially uninitialized" warnings, and the send handler ends up with unused variables.

Since this turned out to be more complex than anticipated, while not a pressing concern at all, I'll put this on the back burner. I'm considering just treating this edge case as unsupported; it seems quite unlikely that an empty variant of a packet that usually carries information would be intended anyhow.

2022-06-07 05:03 更新者: alienvalkyrie
  • 担当者(未割り当て) から alienvalkyrie に更新されました
  • 解決法なし から 受領 に更新されました
コメント

I've gone with the option of explicitly unsupporting this edge case, since again – if it ever actually happens in practice, that's almost certainly an accident.

2022-06-08 20:21 更新者: alienvalkyrie
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました
  • マイルストーン(未割り当て) から 3.2.0 に更新されました

添付ファイルリスト

編集

このチケットにコメントを追加するには、ログインが必要です » ログインする