google / google/gvisor

Support advanced AF_PACKET features in netstack

Open
#1,409 9 comments 1 reaction 1 assignee Claimed by @manninglucas View on GitHub
area: compatibility area: networking area: usability type: enhancement
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

Currently netstack supports only _extremaly_ basic AF_PACKET sockets. Needed features:

- AF_PACKET seem to see _inbound_ only packets. No way to see outbound packets.
- `SIOCETHTOOL` (needed for tcpdump to run)
- `bind(AF_PACKET, ifnumber)` (binding to interface)
- `socket(AF_PACKET, SOCK_RAW, 0)` (for example netsniff-ng uses "zero" as protocol)
- `setsocktopt(SO_ATTACH_FILTER)`
- `setsocktopt(SO_RCVBUF)`
- `setsocktopt(PACKET_AUXDATA)`
- `setsocktopt(SO_DETACH_FILTER)`
- `getsocktopt(PACKET_STATISTICS)`

I wrote a simple C program that can be helpful in testing these features https://gist.github.com/majek/9668716d4bb88fbe562037a912d0ae35

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.