{"url":"https://api.github.com/repos/OpenCyphal/libcanard/pulls/260","id":3979960720,"node_id":"PR_kwDOAmeuxs7tOWGQ","html_url":"https://github.com/OpenCyphal/libcanard/pull/260","diff_url":"https://github.com/OpenCyphal/libcanard/pull/260.diff","patch_url":"https://github.com/OpenCyphal/libcanard/pull/260.patch","issue_url":"https://api.github.com/repos/OpenCyphal/libcanard/issues/260","number":260,"state":"closed","locked":false,"title":"Fix RX behavioral defects: reassembly asserts, filter config, callback re-entrancy","user":{"login":"pavel-kirienko","id":3298404,"node_id":"MDQ6VXNlcjMyOTg0MDQ=","avatar_url":"https://avatars.githubusercontent.com/u/3298404?v=4","gravatar_id":"","url":"https://api.github.com/users/pavel-kirienko","html_url":"https://github.com/pavel-kirienko","followers_url":"https://api.github.com/users/pavel-kirienko/followers","following_url":"https://api.github.com/users/pavel-kirienko/following{/other_user}","gists_url":"https://api.github.com/users/pavel-kirienko/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel-kirienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel-kirienko/subscriptions","organizations_url":"https://api.github.com/users/pavel-kirienko/orgs","repos_url":"https://api.github.com/users/pavel-kirienko/repos","events_url":"https://api.github.com/users/pavel-kirienko/events{/privacy}","received_events_url":"https://api.github.com/users/pavel-kirienko/received_events","type":"User","user_view_type":"public","site_admin":false},"body":"## Summary\n\nv5 TX/RX hardening in two parts. Every fix ships with a regression test that fails on the pre-fix code and passes after.\n\n### RX behavioral fixes (`canard.c`)\n\n- `rx_subscribe`: accumulate `filters_dirty` (`||`) — a duplicate subscribe no longer cancels a pending acceptance-filter reconfiguration (was silent RX loss on filter-capable nodes).\n- `rx_session_accept` / `rx_session_complete_slot`: drop the false `slot->iface_index == ses->iface_index` assert that aborted on valid redundant-interface traffic (per-slot affinity is still enforced at admission).\n- `rx_parse` (v0 anonymous): route on the 2 low data-type-ID bits per the DroneCAN spec (the upper bits are a random discriminator), with a weak HW acceptance filter for v0 DTID ≤ 3 — still one filter entry per subscription.\n- `rx_session_update`: dispatch `on_message` last, so a callback that unsubscribes itself can't cause a use-after-free.\n- `canard_new`: set `filters_dirty = filter_count > 0` so forced Heartbeat/NodeStatus occupancy filters program even before the first subscription.\n- Forced-filter dedup: replace the alias-prone single-frame probe with a filter-coverage (subset) test `rx_filter_covered`.\n\n### Available-interfaces bitmap (intentional `canard_new` API break)\n\n`canard_new()` gains an `iface_bitmap` of the interfaces available on the node, ANDed into every enqueue at the single TX chokepoint (`tx_push`). Requests/responses and all-publishes no longer queue frames for interfaces that can't be drained. A **zero** bitmap declares a **listen-only** node (TX is a clean no-op). Bits beyond `CANARD_IFACE_COUNT` are rejected. Call sites, the demo, and the README example are updated.\n\n## Verification\n\nFull suite green in the Debug build (assertions on); `clang-tidy` + `cppcheck` + `clang-format` clean. Each fix was confirmed to be a real guard by reverting its hunk and watching the test fail — including a refcount/cursor divergence caught under the leak-detecting allocator. The RX and interface changes were each independently reviewed by Codex (gpt-5.5 xhigh) and Claude Fable 5 (xhigh) with no major findings.\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n","created_at":"2026-07-02T16:39:54Z","updated_at":"2026-07-02T21:13:45Z","closed_at":"2026-07-02T21:13:43Z","merged_at":"2026-07-02T21:13:43Z","merge_commit_sha":"120600375535b6a383fbe99a9d77c04b7a65e81a","assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/OpenCyphal/libcanard/pulls/260/commits","review_comments_url":"https://api.github.com/repos/OpenCyphal/libcanard/pulls/260/comments","review_comment_url":"https://api.github.com/repos/OpenCyphal/libcanard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenCyphal/libcanard/issues/260/comments","statuses_url":"https://api.github.com/repos/OpenCyphal/libcanard/statuses/2ed282051e84dcb2fbedf94568a59bfcaa5691ee","head":{"label":"OpenCyphal:fix/rx-behavioral-correctness","ref":"fix/rx-behavioral-correctness","sha":"2ed282051e84dcb2fbedf94568a59bfcaa5691ee","user":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"repo":{"id":40349382,"node_id":"MDEwOlJlcG9zaXRvcnk0MDM0OTM4Mg==","name":"libcanard","full_name":"OpenCyphal/libcanard","private":false,"owner":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"html_url":"https://github.com/OpenCyphal/libcanard","description":"A compact implementation of the Cyphal/CAN protocol in C for high-integrity real-time embedded systems","fork":false,"url":"https://api.github.com/repos/OpenCyphal/libcanard","forks_url":"https://api.github.com/repos/OpenCyphal/libcanard/forks","keys_url":"https://api.github.com/repos/OpenCyphal/libcanard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenCyphal/libcanard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenCyphal/libcanard/teams","hooks_url":"https://api.github.com/repos/OpenCyphal/libcanard/hooks","issue_events_url":"https://api.github.com/repos/OpenCyphal/libcanard/issues/events{/number}","events_url":"https://api.github.com/repos/OpenCyphal/libcanard/events","assignees_url":"https://api.github.com/repos/OpenCyphal/libcanard/assignees{/user}","branches_url":"https://api.github.com/repos/OpenCyphal/libcanard/branches{/branch}","tags_url":"https://api.github.com/repos/OpenCyphal/libcanard/tags","blobs_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenCyphal/libcanard/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenCyphal/libcanard/languages","stargazers_url":"https://api.github.com/repos/OpenCyphal/libcanard/stargazers","contributors_url":"https://api.github.com/repos/OpenCyphal/libcanard/contributors","subscribers_url":"https://api.github.com/repos/OpenCyphal/libcanard/subscribers","subscription_url":"https://api.github.com/repos/OpenCyphal/libcanard/subscription","commits_url":"https://api.github.com/repos/OpenCyphal/libcanard/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenCyphal/libcanard/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenCyphal/libcanard/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenCyphal/libcanard/contents/{+path}","compare_url":"https://api.github.com/repos/OpenCyphal/libcanard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenCyphal/libcanard/merges","archive_url":"https://api.github.com/repos/OpenCyphal/libcanard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenCyphal/libcanard/downloads","issues_url":"https://api.github.com/repos/OpenCyphal/libcanard/issues{/number}","pulls_url":"https://api.github.com/repos/OpenCyphal/libcanard/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenCyphal/libcanard/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenCyphal/libcanard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenCyphal/libcanard/labels{/name}","releases_url":"https://api.github.com/repos/OpenCyphal/libcanard/releases{/id}","deployments_url":"https://api.github.com/repos/OpenCyphal/libcanard/deployments","created_at":"2015-08-07T08:16:09Z","updated_at":"2026-07-06T08:10:54Z","pushed_at":"2026-07-02T21:13:44Z","git_url":"git://github.com/OpenCyphal/libcanard.git","ssh_url":"git@github.com:OpenCyphal/libcanard.git","clone_url":"https://github.com/OpenCyphal/libcanard.git","svn_url":"https://github.com/OpenCyphal/libcanard","homepage":"http://opencyphal.org","size":1087,"stargazers_count":435,"watchers_count":435,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":219,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"has_pull_requests":true,"pull_request_creation_policy":"all","topics":["aerospace","c","c11","can","can-bus","can-fd","canbus","communication-protocol","cyphal","embedded","embedded-systems","misra","opencyphal","protocol","robotics","socketcan","space","uav","uavcan","vehicle-bus"],"visibility":"public","forks":219,"open_issues":0,"watchers":435,"default_branch":"master"}},"base":{"label":"OpenCyphal:master","ref":"master","sha":"254b71601b2d9addf17db0284f4f04a929ff4902","user":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"repo":{"id":40349382,"node_id":"MDEwOlJlcG9zaXRvcnk0MDM0OTM4Mg==","name":"libcanard","full_name":"OpenCyphal/libcanard","private":false,"owner":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"html_url":"https://github.com/OpenCyphal/libcanard","description":"A compact implementation of the Cyphal/CAN protocol in C for high-integrity real-time embedded systems","fork":false,"url":"https://api.github.com/repos/OpenCyphal/libcanard","forks_url":"https://api.github.com/repos/OpenCyphal/libcanard/forks","keys_url":"https://api.github.com/repos/OpenCyphal/libcanard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenCyphal/libcanard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenCyphal/libcanard/teams","hooks_url":"https://api.github.com/repos/OpenCyphal/libcanard/hooks","issue_events_url":"https://api.github.com/repos/OpenCyphal/libcanard/issues/events{/number}","events_url":"https://api.github.com/repos/OpenCyphal/libcanard/events","assignees_url":"https://api.github.com/repos/OpenCyphal/libcanard/assignees{/user}","branches_url":"https://api.github.com/repos/OpenCyphal/libcanard/branches{/branch}","tags_url":"https://api.github.com/repos/OpenCyphal/libcanard/tags","blobs_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenCyphal/libcanard/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenCyphal/libcanard/languages","stargazers_url":"https://api.github.com/repos/OpenCyphal/libcanard/stargazers","contributors_url":"https://api.github.com/repos/OpenCyphal/libcanard/contributors","subscribers_url":"https://api.github.com/repos/OpenCyphal/libcanard/subscribers","subscription_url":"https://api.github.com/repos/OpenCyphal/libcanard/subscription","commits_url":"https://api.github.com/repos/OpenCyphal/libcanard/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenCyphal/libcanard/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenCyphal/libcanard/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenCyphal/libcanard/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenCyphal/libcanard/contents/{+path}","compare_url":"https://api.github.com/repos/OpenCyphal/libcanard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenCyphal/libcanard/merges","archive_url":"https://api.github.com/repos/OpenCyphal/libcanard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenCyphal/libcanard/downloads","issues_url":"https://api.github.com/repos/OpenCyphal/libcanard/issues{/number}","pulls_url":"https://api.github.com/repos/OpenCyphal/libcanard/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenCyphal/libcanard/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenCyphal/libcanard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenCyphal/libcanard/labels{/name}","releases_url":"https://api.github.com/repos/OpenCyphal/libcanard/releases{/id}","deployments_url":"https://api.github.com/repos/OpenCyphal/libcanard/deployments","created_at":"2015-08-07T08:16:09Z","updated_at":"2026-07-06T08:10:54Z","pushed_at":"2026-07-02T21:13:44Z","git_url":"git://github.com/OpenCyphal/libcanard.git","ssh_url":"git@github.com:OpenCyphal/libcanard.git","clone_url":"https://github.com/OpenCyphal/libcanard.git","svn_url":"https://github.com/OpenCyphal/libcanard","homepage":"http://opencyphal.org","size":1087,"stargazers_count":435,"watchers_count":435,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":219,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"has_pull_requests":true,"pull_request_creation_policy":"all","topics":["aerospace","c","c11","can","can-bus","can-fd","canbus","communication-protocol","cyphal","embedded","embedded-systems","misra","opencyphal","protocol","robotics","socketcan","space","uav","uavcan","vehicle-bus"],"visibility":"public","forks":219,"open_issues":0,"watchers":435,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenCyphal/libcanard/pulls/260"},"html":{"href":"https://github.com/OpenCyphal/libcanard/pull/260"},"issue":{"href":"https://api.github.com/repos/OpenCyphal/libcanard/issues/260"},"comments":{"href":"https://api.github.com/repos/OpenCyphal/libcanard/issues/260/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenCyphal/libcanard/pulls/260/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenCyphal/libcanard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenCyphal/libcanard/pulls/260/commits"},"statuses":{"href":"https://api.github.com/repos/OpenCyphal/libcanard/statuses/2ed282051e84dcb2fbedf94568a59bfcaa5691ee"}},"author_association":"MEMBER","auto_merge":null,"assignee":null,"active_lock_reason":null,"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"pavel-kirienko","id":3298404,"node_id":"MDQ6VXNlcjMyOTg0MDQ=","avatar_url":"https://avatars.githubusercontent.com/u/3298404?v=4","gravatar_id":"","url":"https://api.github.com/users/pavel-kirienko","html_url":"https://github.com/pavel-kirienko","followers_url":"https://api.github.com/users/pavel-kirienko/followers","following_url":"https://api.github.com/users/pavel-kirienko/following{/other_user}","gists_url":"https://api.github.com/users/pavel-kirienko/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel-kirienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel-kirienko/subscriptions","organizations_url":"https://api.github.com/users/pavel-kirienko/orgs","repos_url":"https://api.github.com/users/pavel-kirienko/repos","events_url":"https://api.github.com/users/pavel-kirienko/events{/privacy}","received_events_url":"https://api.github.com/users/pavel-kirienko/received_events","type":"User","user_view_type":"public","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":509,"deletions":94,"changed_files":16}