Model SOCK_OPS flow lifetime independently of classify execution

オープン
#346 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp

調査の方向性

Start from the simulated SOCK_OPS APIs, where flow ID creation and the synchronous WFP classify call happen in one operation, and from the flowDeleteFn path for associated contexts. Split creation, classification for an existing flow ID, and deletion into separate operations, keeping the synchronous helpers as wrappers. Done means IPv4 and IPv6 tests delete a flow before, during, and after classification, with exactly one flowDeleteFn callback per associated context.

索引モデルが issue の本文から書いたものです。

説明

Problem

The simulated SOCK_OPS APIs create a flow ID and synchronously invoke the WFP classify callback in one operation. The caller does not regain control until classification completes, so a test cannot publish the simulated flow as live and delete that same flow while its established callback is running.

This prevents usersim from faithfully modeling independent WFP flow creation, classification, and deletion, and leaves the original SOCK_OPS association/program-invocation race difficult to regression-test without test-only synchronization inside the program callback.

Originating review: https://github.com/microsoft/ebpf-for-windows/pull/5623#discussion_r4450724952

Desired behavior

Represent a simulated network flow separately from an optional WFP flow-context association. Tests should be able to:

  1. Create a flow and receive its flow ID.
  2. Invoke classification for that existing flow ID.
  3. Delete the flow before, during, or after classification.

The existing synchronous helpers can remain as compatibility wrappers over the split operations.

Acceptance criteria

  • IPv4 and IPv6 SOCK_OPS flows can be created before classification begins.
  • Classification accepts an existing flow ID rather than always allocating one internally.
  • Flow deletion is safe before association, during classification, and after association.
  • An associated context receives exactly one flowDeleteFn callback.
  • Existing usersim callers retain compatible behavior.
  • Tests cover the three deletion timings for both address families.
主要言語
C++
スター
112
フォーク
36
平均マージ
8日 10時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/usersim のほかの issue

microsoft/usersim の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。