-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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 UDP send to IPv6 link local addresses #6541
Conversation
Thanks ! |
lwIP's tcp/udp_connect() and tcp/udp_bind() functions automatically set the zone if it is required but missing, but udp_connect() is not used so this doesn't happen. Explicitly set the zone to the default network interface if it is required for the type of address being used. Otherwise there is no zone set and packets to a link local destination don't go anywhere.
adec19d
to
3aeb851
Compare
I've just tried using |
I had been testing TCP with edit: didn't work after dedicated test (I might have tried the other way around) |
No, I've not tested TCP at all. Did you set or bind a source address explicitly? If it works without specifying a source address then it would be reasonable to apply this fix so that UDP works too. |
No. I assume this issue would exist only for client not server, but it can also be tried with server examples. Under linux, link-local server addresses must be extended with |
What is the status here? |
@nomis ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change, IPv6 UDP packets to fe80::
do not leave esp (Udp.endPacket() == 0)
.
With this change, I can see them with tcpdump
on my router.
This change is also necessary for TCP (credit will be given). |
lwIP's tcp/udp_connect() and tcp/udp_bind() functions automatically
set the zone if it is required but missing, but udp_connect() is not
used so this doesn't happen.
Explicitly set the zone to the default network interface if it is
required for the type of address being used. Otherwise there is no
zone set and packets to a link local destination don't go anywhere.