Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sending and handling keepalives #62

Merged
merged 3 commits into from
Sep 23, 2024
Merged

Fix sending and handling keepalives #62

merged 3 commits into from
Sep 23, 2024

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented Sep 21, 2024

  • Both Firefox and Chrome requires Username in binding requests sent as consent freshness. Although we don't fully implement consent freshness, we use binding requests as keepalives so I added Username, Piority and Controlling/Controlled attributes, the same way browsers add them.
  • Now keepalive responses are checked against symmetry of addresses, authenticity and success/error class. We only update last_seen when a response is successful, it comes from a symmetric address and is authentic.
  • Our logs heavily uses pair id, which makes it a little difficult to connect pair_id with local and remote candidates address. Introduced a pair_info function that makes it easier to log information about pair. I will replace old logs incrementally.
  • To be consistent with other timers :keepalive -> :keepalive_timeout and handle_keepalive -> handle_keepalive_timeout

Copy link

codecov bot commented Sep 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.45%. Comparing base (d29d025) to head (5cd659a).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #62      +/-   ##
==========================================
- Coverage   82.71%   81.45%   -1.26%     
==========================================
  Files          25       25              
  Lines        1527     1548      +21     
==========================================
- Hits         1263     1261       -2     
- Misses        264      287      +23     
Files with missing lines Coverage Δ
lib/ex_ice/ice_agent.ex 58.46% <100.00%> (ø)
lib/ex_ice/priv/candidate_pair.ex 59.09% <100.00%> (-4.55%) ⬇️
lib/ex_ice/priv/ice_agent.ex 83.78% <100.00%> (-1.89%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d29d025...5cd659a. Read the comment docs.

@mickel8 mickel8 requested a review from sgfn September 21, 2024 14:10
Comment on lines 1660 to 1666
Logger.warning("""
Ignoring keepalive success response, non-symmetric src and dst addresses.
Sent from: #{inspect({ka_local_cand.base.base_address, ka_local_cand.base.base_port})}, \
to: #{inspect({ka_remote_cand.address, ka_remote_cand.port})}
Recv from: #{inspect({src_ip, src_port})}, on: #{inspect({local_cand.base.base_address, local_cand.base.base_port})} \
Not refreshing last_seen time. \
""")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a warning log? Is it more important than e.g. the one from the error response?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it to debug one

@mickel8 mickel8 merged commit 9a4eeac into master Sep 23, 2024
2 checks passed
@mickel8 mickel8 deleted the keepalive branch September 23, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants