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

router: drop packets with invalid IPv4/6 destination address #4558

Closed
JordiSubira opened this issue Jul 1, 2024 · 0 comments · Fixed by #4579
Closed

router: drop packets with invalid IPv4/6 destination address #4558

JordiSubira opened this issue Jul 1, 2024 · 0 comments · Fixed by #4579
Assignees
Labels
bug Something isn't working

Comments

@JordiSubira
Copy link
Contributor

The router forwards packets relying on whatever the system call, i.e., unix.Sendmsg does with UDP messages with destination address 0.0.0.0. One could expect that the syscall returns an error, however, what it does is the following (based on a toy example I creted for trying this out):

  • If internal BR address (or local_IP) uses IPv4 and destination address is 0.0.0.0: Sends a packet with destination_IP = local_IP
  • If internal BR address (or local_IP) uses IPv6 and destination address is 0.0.0.0: Yields an error Error sending message: network is unreachable
  • If internal BR address (or local_IP) uses IPv6 and destination address is [::]: Sends a packet with destination_IP = local_IP
  • If internal BR address (or local_IP) uses IPv4 and destination address is [::]: Yields an error Error sending message: network is unreachable

(One can reproduce it using this simple code snippet https://gist.github.com/JordiSubira/4171baa5b0535878bebf4c93eb1688e5).

Based on an offline discussion, Anapaya's BR drops packets with 0.0.0.0, [::], loopback/localhost or ipv4-mapped-ipv6 destination addresses. Thus, the common conclusion is that we should reproduce this in the OS-BR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants