From b0ee04a097a83b15cd83e4c64464740aadda0f17 Mon Sep 17 00:00:00 2001 From: Jing Chen Date: Mon, 8 Jul 2024 13:46:58 -0700 Subject: [PATCH] Skip IFLA_TXQLEN and IFA_BROADCAST in gVisor. The attributes are expected by Dockerd to start. In gVisor, skipping the attributes is good enough to run the Docker workloads. PiperOrigin-RevId: 650362257 --- pkg/sentry/socket/netlink/route/protocol.go | 4 ++++ pkg/sentry/socket/netstack/stack.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/pkg/sentry/socket/netlink/route/protocol.go b/pkg/sentry/socket/netlink/route/protocol.go index 80f224a0a..597f711e1 100644 --- a/pkg/sentry/socket/netlink/route/protocol.go +++ b/pkg/sentry/socket/netlink/route/protocol.go @@ -515,6 +515,10 @@ func (p *Protocol) newAddr(ctx context.Context, s *netlink.Socket, msg *nlmsg.Me return syserr.ErrInvalidArgument } case linux.IFA_ADDRESS: + case linux.IFA_BROADCAST: + // TODO(b/340929168): support IFA_BROADCAST. The standard + // broadcast address (the last IP address of the subnet) is + // used by default. default: ctx.Warningf("Unknown attribute: %v", ahdr.Type) return syserr.ErrNotSupported diff --git a/pkg/sentry/socket/netstack/stack.go b/pkg/sentry/socket/netstack/stack.go index 639b1b125..83cd186db 100644 --- a/pkg/sentry/socket/netstack/stack.go +++ b/pkg/sentry/socket/netstack/stack.go @@ -137,6 +137,7 @@ func (s *Stack) SetInterface(ctx context.Context, msg *nlmsg.Message) *syserr.Er case linux.IFLA_ADDRESS: case linux.IFLA_MTU: case linux.IFLA_NET_NS_FD: + case linux.IFLA_TXQLEN: default: ctx.Warningf("unexpected attribute: %x", attr) return syserr.ErrNotSupported @@ -225,6 +226,8 @@ func (s *Stack) setLink(ctx context.Context, id tcpip.NICID, linkAttrs map[uint1 if err := s.Stack.SetNICMTU(id, mtu); err != nil { return syserr.TranslateNetstackError(err) } + case linux.IFLA_TXQLEN: + // TODO(b/340388892): support IFLA_TXQLEN. } } return nil