Skip to content

Error on attempts at writing martian packets#538

Open
reynir wants to merge 2 commits intomirage:mainfrom
reynir:no-martians
Open

Error on attempts at writing martian packets#538
reynir wants to merge 2 commits intomirage:mainfrom
reynir:no-martians

Conversation

@reynir
Copy link
Copy Markdown
Member

@reynir reynir commented Feb 24, 2026

If we try to write to a loopback address we error out. This is perhaps not ideal, but sending IP packets with loopback addresses is not allowed according to RFC 1122.

I'm not sure what to do with such packets. Ideally, they would instead be written to a loopback interface, but I don't think we have that.

Something similar should likely be done for ipv6, and there may be other addresses which we need to handle differently.

See also #537

If we try to write to a loopback address we error out. This is perhaps
not ideal, but sending IP packets with loopback addresses is not allowed
according to RFC 1122.
Copy link
Copy Markdown
Member

@hannesm hannesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me.

@reynir
Copy link
Copy Markdown
Member Author

reynir commented Mar 2, 2026

The latest commit basically adds if dst = ::1 then Error something else in the beginning of write in the IPv6 implementation. I'm not sure that's sufficient as there might be other places where routing is done. Changing the neighbor discovery code to implement this seemed less straightforward. So maybe we should drop that commit and think about other implementations?

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.

2 participants