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

feat(net): implement the address resolution network struct functions #2773

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

Green-Sky
Copy link
Member

@Green-Sky Green-Sky commented Oct 11, 2024

  • implement getaddrinfo and freeaddrinfo
  • do we need stocktype/protocol?
  • replace all uses of getaddrinfo()
    • addr_resolve()
    • net_getipport()


This pr finally allows us to implement a regression test for #2361

Also allows fuzzing returned results from DNS.


This pr implements a different approach to disabling DNS, compared to #2694, here we can simply replace the functions pointers in the network object with dummies/stubs.


This change is Reviewable

@Green-Sky Green-Sky force-pushed the network_work1 branch 6 times, most recently from b13285b to 992769c Compare October 12, 2024 09:21
Copy link

codecov bot commented Oct 12, 2024

Codecov Report

Attention: Patch coverage is 71.05263% with 22 lines in your changes missing coverage. Please review.

Project coverage is 73.21%. Comparing base (41fb183) to head (956cd08).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
toxcore/network.c 72.85% 19 Missing ⚠️
toxcore/network_test_util.cc 0.00% 2 Missing ⚠️
toxcore/DHT.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2773      +/-   ##
==========================================
+ Coverage   72.89%   73.21%   +0.31%     
==========================================
  Files         149      149              
  Lines       30570    30595      +25     
==========================================
+ Hits        22285    22401     +116     
+ Misses       8285     8194      -91     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Green-Sky Green-Sky force-pushed the network_work1 branch 2 times, most recently from 62852fe to b076947 Compare October 12, 2024 09:56
@Green-Sky Green-Sky added network Network bootstrap Bootstrap refactor Refactoring production code, eg. renaming a variable, not affecting semantics labels Oct 12, 2024
@Green-Sky Green-Sky force-pushed the network_work1 branch 7 times, most recently from 98d4d9b to 23befb9 Compare October 13, 2024 10:06
@Green-Sky Green-Sky changed the title feat: implement the last 2 missing network struct functions feat(net): implement the last 2 missing network struct functions Oct 16, 2024
@Green-Sky Green-Sky force-pushed the network_work1 branch 2 times, most recently from 726b2da to 7fb9d41 Compare October 16, 2024 10:14
toxcore/net_obj.h Outdated Show resolved Hide resolved
@iphydf iphydf added this to the v0.2.21 milestone Nov 9, 2024
@github-actions github-actions bot added the enhancement New feature for the user, not a new feature for build script label Nov 13, 2024
toxcore/network.c Outdated Show resolved Hide resolved
toxcore/network.c Outdated Show resolved Hide resolved
@pull-request-attention pull-request-attention bot assigned Green-Sky and unassigned iphydf Nov 27, 2024
@Green-Sky Green-Sky force-pushed the network_work1 branch 5 times, most recently from 23f7f96 to 916715f Compare November 27, 2024 22:36
@Green-Sky Green-Sky marked this pull request as ready for review November 27, 2024 22:53
toxcore/network.c Outdated Show resolved Hide resolved
@Green-Sky Green-Sky force-pushed the network_work1 branch 2 times, most recently from 3f2628d to 81e1233 Compare November 28, 2024 11:42
@Green-Sky Green-Sky changed the title feat(net): implement the last 2 missing network struct functions feat(net): implement the address resolution network struct functions Nov 28, 2024
@Green-Sky Green-Sky requested a review from a team November 28, 2024 11:58
@Green-Sky Green-Sky force-pushed the network_work1 branch 2 times, most recently from c79b2f7 to 95a1596 Compare November 28, 2024 14:04
@Green-Sky Green-Sky force-pushed the network_work1 branch 3 times, most recently from 956cd08 to a16899d Compare November 28, 2024 15:07
@Green-Sky Green-Sky merged commit ac81287 into TokTok:master Nov 28, 2024
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bootstrap Bootstrap enhancement New feature for the user, not a new feature for build script network Network refactor Refactoring production code, eg. renaming a variable, not affecting semantics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants