gvisor icon indicating copy to clipboard operation
gvisor copied to clipboard

Dont depend on loopback LinkEndpoint for looping

Open ghananigans opened this issue 5 years ago • 9 comments

Currently the network layer depends on the loopback interface's LinkEndpoint to loop a packet back to the stack without sending it out the "wire"

We should make it so that the loopback back of packets to the loopback interface be handled at the network-layer instead. This will remove the need to special-case loopback interfaces when handling locally-handled packets and creating local routes.

ghananigans avatar Oct 29 '20 17:10 ghananigans

Could you elaborate on what you are proposing? Maybe with a small snippet.

hbhasker avatar Oct 31 '20 14:10 hbhasker

basically we loop-back traffic destined to loopback address at the link endpoint (loopback.Endpoint), but im proposing looping it back at the network layer.

Right now, we don't allow network layer looping if the interface is a loopback interface.

ghananigans avatar Nov 03 '20 05:11 ghananigans

I don't think that's a good idea. It will mean loopback packets are invisible to sniffer and tcpdump etc. What do we expect to gain from this? loopback is at the end of the day a link endpoint that happens to just loop things back. One can even assign loopback endpoints other addresses other than the default 127.0.0.1/8 / ::1 . Making these decisions at IP layer is probably not the right thing to do.

hbhasker avatar Nov 03 '20 21:11 hbhasker

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Feb 02 '21 00:02 github-actions[bot]

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar May 04 '21 00:05 github-actions[bot]

A friendly reminder that this issue had no activity for 120 days.

github-actions[bot] avatar Sep 14 '23 00:09 github-actions[bot]

A friendly reminder that this issue had no activity for 120 days.

github-actions[bot] avatar Feb 09 '24 00:02 github-actions[bot]

This issue has been closed due to lack of activity.

github-actions[bot] avatar May 09 '24 00:05 github-actions[bot]

There are TODOs still referencing this issue:

  1. pkg/tcpip/stack/route.go:186: Loopback interface loops back packets at the
  2. pkg/tcpip/stack/route.go:267: Loopback interface loops back packets at the

Search TODO

github-actions[bot] avatar May 10 '24 00:05 github-actions[bot]