mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
clean up tcpdump TODOs
tcpdump is largely supported. We've also chose not to implement writeable AF_PACKET sockets, and there's a bug specifically for promiscuous mode (#3333). Fixes #173. PiperOrigin-RevId: 380733686
This commit is contained in:
committed by
gVisor bot
parent
1e472a8572
commit
c6da1b0022
@@ -49,44 +49,44 @@ Most common utilities work. Note that:
|
||||
|
||||
<!-- mdformat off(don't wrap the table) -->
|
||||
|
||||
| Tool | Status |
|
||||
|:--------:|:-----------------------------------------:|
|
||||
| apt-get | Working. |
|
||||
| bundle | Working. |
|
||||
| cat | Working. |
|
||||
| curl | Working. |
|
||||
| dd | Working. |
|
||||
| df | Working. |
|
||||
| dig | Working. |
|
||||
| drill | Working. |
|
||||
| env | Working. |
|
||||
| find | Working. |
|
||||
| gcore | Working. |
|
||||
| gdb | Working. |
|
||||
| gosu | Working. |
|
||||
| grep | Working (unless stdin is a pipe and stdout is /dev/null). |
|
||||
| ifconfig | Works partially, like ip. Full support [in progress](https://gvisor.dev/issue/578). |
|
||||
| ip | Some subcommands work (e.g. addr, route). Full support [in progress](https://gvisor.dev/issue/578). |
|
||||
| less | Working. |
|
||||
| ls | Working. |
|
||||
| lsof | Working. |
|
||||
| mount | Works in readonly mode. gVisor doesn't currently support creating new mounts at runtime. |
|
||||
| nc | Working. |
|
||||
| nmap | Not working. |
|
||||
| netstat | [In progress](https://gvisor.dev/issue/2112). |
|
||||
| nslookup | Working. |
|
||||
| ping | Working. |
|
||||
| ps | Working. |
|
||||
| route | Working. |
|
||||
| ss | [In progress](https://gvisor.dev/issue/2114). |
|
||||
| sshd | Partially working. Job control [in progress](https://gvisor.dev/issue/154). |
|
||||
| strace | Working. |
|
||||
| tar | Working. |
|
||||
| tcpdump | [In progress](https://gvisor.dev/issue/173). |
|
||||
| top | Working. |
|
||||
| uptime | Working. |
|
||||
| vim | Working. |
|
||||
| wget | Working. |
|
||||
| Tool | Status |
|
||||
| :--------: | :-----------------------------------------: |
|
||||
| apt-get | Working. |
|
||||
| bundle | Working. |
|
||||
| cat | Working. |
|
||||
| curl | Working. |
|
||||
| dd | Working. |
|
||||
| df | Working. |
|
||||
| dig | Working. |
|
||||
| drill | Working. |
|
||||
| env | Working. |
|
||||
| find | Working. |
|
||||
| gcore | Working. |
|
||||
| gdb | Working. |
|
||||
| gosu | Working. |
|
||||
| grep | Working (unless stdin is a pipe and stdout is /dev/null). |
|
||||
| ifconfig | Works partially, like ip. Full support [in progress](https://gvisor.dev/issue/578). |
|
||||
| ip | Some subcommands work (e.g. addr, route). Full support [in progress](https://gvisor.dev/issue/578). |
|
||||
| less | Working. |
|
||||
| ls | Working. |
|
||||
| lsof | Working. |
|
||||
| mount | Works in readonly mode. gVisor doesn't currently support creating new mounts at runtime. |
|
||||
| nc | Working. |
|
||||
| nmap | Not working. |
|
||||
| netstat | [In progress](https://gvisor.dev/issue/2112). |
|
||||
| nslookup | Working. |
|
||||
| ping | Working. |
|
||||
| ps | Working. |
|
||||
| route | Working. |
|
||||
| ss | [In progress](https://gvisor.dev/issue/2114). |
|
||||
| sshd | Partially working. Job control [in progress](https://gvisor.dev/issue/154). |
|
||||
| strace | Working. |
|
||||
| tar | Working. |
|
||||
| tcpdump | Working. [Promiscuous mode in progress](https://gvisor.dev/issue/3333). |
|
||||
| top | Working. |
|
||||
| uptime | Working. |
|
||||
| vim | Working. |
|
||||
| wget | Working. |
|
||||
|
||||
<!-- mdformat on -->
|
||||
|
||||
|
||||
@@ -659,7 +659,6 @@ func ConvertAddress(family int, addr tcpip.FullAddress) (linux.SockAddr, uint32)
|
||||
return &out, uint32(sockAddrInet6Size)
|
||||
|
||||
case linux.AF_PACKET:
|
||||
// TODO(gvisor.dev/issue/173): Return protocol too.
|
||||
var out linux.SockAddrLink
|
||||
out.Family = linux.AF_PACKET
|
||||
out.InterfaceIndex = int32(addr.NIC)
|
||||
@@ -749,7 +748,6 @@ func AddressAndFamily(addr []byte) (tcpip.FullAddress, uint16, *syserr.Error) {
|
||||
return tcpip.FullAddress{}, family, syserr.ErrInvalidArgument
|
||||
}
|
||||
|
||||
// TODO(gvisor.dev/issue/173): Return protocol too.
|
||||
return tcpip.FullAddress{
|
||||
NIC: tcpip.NICID(a.InterfaceIndex),
|
||||
Addr: tcpip.Address(a.HardwareAddr[:header.EthernetAddressSize]),
|
||||
|
||||
@@ -208,7 +208,6 @@ func (ep *endpoint) Read(dst io.Writer, opts tcpip.ReadOptions) (tcpip.ReadResul
|
||||
}
|
||||
|
||||
func (*endpoint) Write(tcpip.Payloader, tcpip.WriteOptions) (int64, tcpip.Error) {
|
||||
// TODO(gvisor.dev/issue/173): Implement.
|
||||
return 0, &tcpip.ErrInvalidOptionValue{}
|
||||
}
|
||||
|
||||
@@ -244,8 +243,6 @@ func (*endpoint) Accept(*tcpip.FullAddress) (tcpip.Endpoint, *waiter.Queue, tcpi
|
||||
|
||||
// Bind implements tcpip.Endpoint.Bind.
|
||||
func (ep *endpoint) Bind(addr tcpip.FullAddress) tcpip.Error {
|
||||
// TODO(gvisor.dev/issue/173): Add Bind support.
|
||||
|
||||
// "By default, all packets of the specified protocol type are passed
|
||||
// to a packet socket. To get packets only from a specific interface
|
||||
// use bind(2) specifying an address in a struct sockaddr_ll to bind
|
||||
@@ -385,7 +382,6 @@ func (ep *endpoint) HandlePacket(nicID tcpip.NICID, localAddr tcpip.LinkAddress,
|
||||
|
||||
// Push new packet into receive list and increment the buffer size.
|
||||
var packet packet
|
||||
// TODO(gvisor.dev/issue/173): Return network protocol.
|
||||
if !pkt.LinkHeader().View().IsEmpty() {
|
||||
// Get info directly from the ethernet header.
|
||||
hdr := header.Ethernet(pkt.LinkHeader().View())
|
||||
|
||||
@@ -55,8 +55,6 @@
|
||||
//
|
||||
// These tests require CAP_NET_RAW to run.
|
||||
|
||||
// TODO(gvisor.dev/issue/173): gVisor support.
|
||||
|
||||
namespace gvisor {
|
||||
namespace testing {
|
||||
|
||||
@@ -188,7 +186,6 @@ void ReceiveMessage(int sock, int ifindex) {
|
||||
// sizeof(sockaddr_ll).
|
||||
ASSERT_THAT(src_len, AnyOf(Eq(sizeof(src)), Eq(sizeof(src) - 2)));
|
||||
|
||||
// TODO(gvisor.dev/issue/173): Verify protocol once we return it.
|
||||
// Verify the source address.
|
||||
EXPECT_EQ(src.sll_family, AF_PACKET);
|
||||
EXPECT_EQ(src.sll_ifindex, ifindex);
|
||||
@@ -234,7 +231,7 @@ TEST_P(CookedPacketTest, Receive) {
|
||||
|
||||
// Send via a packet socket.
|
||||
TEST_P(CookedPacketTest, Send) {
|
||||
// TODO(gvisor.dev/issue/173): Remove once we support packet socket writing.
|
||||
// We don't implement writing to packet sockets on gVisor.
|
||||
SKIP_IF(IsRunningOnGvisor());
|
||||
|
||||
// Let's send a UDP packet and receive it using a regular UDP socket.
|
||||
|
||||
@@ -56,8 +56,6 @@
|
||||
//
|
||||
// These tests require CAP_NET_RAW to run.
|
||||
|
||||
// TODO(gvisor.dev/issue/173): gVisor support.
|
||||
|
||||
namespace gvisor {
|
||||
namespace testing {
|
||||
|
||||
@@ -193,7 +191,6 @@ TEST_P(RawPacketTest, Receive) {
|
||||
// sizeof(sockaddr_ll).
|
||||
ASSERT_THAT(src_len, AnyOf(Eq(sizeof(src)), Eq(sizeof(src) - 2)));
|
||||
|
||||
// TODO(gvisor.dev/issue/173): Verify protocol once we return it.
|
||||
// Verify the source address.
|
||||
EXPECT_EQ(src.sll_family, AF_PACKET);
|
||||
EXPECT_EQ(src.sll_ifindex, GetLoopbackIndex());
|
||||
@@ -238,7 +235,7 @@ TEST_P(RawPacketTest, Receive) {
|
||||
|
||||
// Send via a packet socket.
|
||||
TEST_P(RawPacketTest, Send) {
|
||||
// TODO(gvisor.dev/issue/173): Remove once we support packet socket writing.
|
||||
// We don't implement writing to packet sockets on gVisor.
|
||||
SKIP_IF(IsRunningOnGvisor());
|
||||
|
||||
// Let's send a UDP packet and receive it using a regular UDP socket.
|
||||
|
||||
Reference in New Issue
Block a user