algesten / str0m

A Sans I/O WebRTC implementation in Rust.
MIT License
317 stars 49 forks source link

fix: only invalidate candidates of the same kind #504

Closed thomaseizinger closed 5 months ago

thomaseizinger commented 5 months ago

We ran into a bug where a candidate was incorrectly invalidated based on IP only without considering the kind of candidate. The bug was in our software because we didn't invalidate a host candidate and our tests didn't catch it because there, we invalidated it "accidentially" by wanting to invalidate the corresponding srflx candidate. The (unit)-tests don't have a NAT so there host == srflx. But in the real world, we had a NAT but the two nodes were on the same subnet, thus they ended up making a host-host connection and failed to migrate that to another candidate because it was never invalidated.

algesten commented 5 months ago

It's our own API, if we want kind, I don't see why not.

thomaseizinger commented 5 months ago

@algesten Rebased on latest main now that #498 is merged.