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

Still sends IPv6 messages despite the IPv6 options being turned off #1432

Open
yurivict opened this issue Apr 19, 2020 · 4 comments
Open

Still sends IPv6 messages despite the IPv6 options being turned off #1432

yurivict opened this issue Apr 19, 2020 · 4 comments
Assignees
Labels
P3 Low priority
Milestone

Comments

@yurivict
Copy link
Member

toxcore-0.2.11,1
qTox-1.16.3.882
FreeBSD 12.1

A lot of messages like this are printed into the log, both during start and later:

[17:01:32.823 UTC] network.c:515 : Critical: attempted to send message with network family 10 (probably IPv6) on IPv4 socket
[17:01:33.825 UTC] network.c:515 : Critical: attempted to send message with network family 10 (probably IPv6) on IPv4 socket
[17:01:33.826 UTC] network.c:515 : Critical: attempted to send message with network family 10 (probably IPv6) on IPv4 socket

Enable IPv6 is off.

@nurupo
Copy link
Member

nurupo commented Apr 20, 2020

It doesn't send any IPv6 network packets. This log message says that toxcore was about to send a packet to an IPv6 address using AF_INET socket, but doing so makes no sense, so it caught that and didn't send that packet.

c-toxcore/toxcore/network.c

Lines 512 to 517 in 30b9369

/* socket TOX_AF_INET, but target IP NOT: can't send */
if (net_family_is_ipv4(net->family) && !net_family_is_ipv4(ip_port.ip.family)) {
LOGGER_ERROR(net->log, "attempted to send message with network family %d (probably IPv6) on IPv4 socket",
ip_port.ip.family.value);
return -1;
}

Still, the existence of this error message implies that whoever calls sendpacket() is responsible for making sure that this condition of sending to IPv6 address using IPv4 socket doesn't happen, so I guess it's kind of a bug? If it was a normal part of operation, it wouldn't be printing error messages. So the question is which part of toxcore does this this and how we can fix it. (Or we could change our assumption that whoever calls sendpacket() should check for this and just drop the log call).

@iphydf iphydf added this to the v0.2.x milestone Apr 24, 2020
@iphydf iphydf added the P3 Low priority label Apr 27, 2020
@JFreegman JFreegman self-assigned this Feb 6, 2022
@reyaz006
Copy link

This log message pops up about every 5 seconds. Any way to make it not do that or disable log completely?

@iphydf
Copy link
Member

iphydf commented Apr 30, 2022

Would you be able to run this in gdb and give a stack trace for when this log message happens?

$ gdb ./myclient
...
(gdb) br network.c:514
(gdb) r
...
(gdb) bt

@reyaz006
Copy link

Any way to do this with a compiled Windows version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Low priority
Development

No branches or pull requests

5 participants