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
This commit is contained in:
Jing Chen
2024-07-08 13:49:26 -07:00
committed by gVisor bot
parent 45a6ffe568
commit b0ee04a097
2 changed files with 7 additions and 0 deletions
@@ -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
+3
View File
@@ -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