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: Fake broadcast address for 127.x.x.x #2760

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iacore
Copy link

@iacore iacore commented Jul 10, 2024

Closes #2749

Thanks @zoff99 for the idea


This change is Reviewable

@zoff99
Copy link

zoff99 commented Jul 10, 2024

@iacore does it work in parallel with normal LAN discovery? meaning will it use lo: and eth0: at the same time?
if you have some time, can you add a test case that it works?
here: https://github.com/TokTok/c-toxcore/blob/master/auto_tests/lan_discovery_test.c

@zoff99 zoff99 changed the title Fake broadcast address for 127.x.x.x fix: Fake broadcast address for 127.x.x.x Jul 10, 2024
@iacore
Copy link
Author

iacore commented Jul 11, 2024

@iacore does it work in parallel with normal LAN discovery? meaning will it use lo: and eth0: at the same time?

the code says yes, so i guess yes.

if you have some time, can you add a test case that it works? here: https://github.com/TokTok/c-toxcore/blob/master/auto_tests/lan_discovery_test.c

i have no idea how to do that. sorry.

@zoff99
Copy link

zoff99 commented Jul 12, 2024

it works pretty well. nicely done. what would it do on localhost in ipv6 ?

@zoff99
Copy link

zoff99 commented Jul 12, 2024

@iphydf @Green-Sky this PR works for me. are there any security implications of this? or other bad things in your view?

@iacore
Copy link
Author

iacore commented Jul 12, 2024

it works pretty well. nicely done. what would it do on localhost in ipv6 ?

No, and I'm afraid that the whole broadcast logic doesn't take ipv6 into account. See https://github.com/TokTok/c-toxcore/pull/2760/files#diff-907bc1ea87830b3899d91912c9b7c2eb62d713dadf887012b60bc79aa9bc4b01R186

@zoff99
Copy link

zoff99 commented Jul 12, 2024

@Green-Sky
Copy link
Member

it works pretty well. nicely done. what would it do on localhost in ipv6 ?

No, and I'm afraid that the whole broadcast logic doesn't take ipv6 into account. See https://github.com/TokTok/c-toxcore/pull/2760/files#diff-907bc1ea87830b3899d91912c9b7c2eb62d713dadf887012b60bc79aa9bc4b01R186

ipv4 should be available everywhere, at least for localhost.
Also the ioctl interface we use here only supports ipv4...

@Green-Sky this PR works for me. are there any security implications of this? or other bad things in your view?

will have to check, code looks ok beside some styling nitpicks.

@nurupo nurupo mentioned this pull request Jul 13, 2024
@iphydf iphydf added this to the v0.2.21 milestone Nov 9, 2024
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.

make tox use loopback device on linux when UDP and local lan is turned on
4 participants