IFLA_IFNAME is used to set an interface's name when being used
with RTM_NEWLINK and RTM_SETLINK. RTM_NEWLINK is the preferred way, it
is backwards compatible with RTM_SETLINK. For gVisor, when RTM_SETLINK is
introduced, it shall just share the implementation.
PiperOrigin-RevId: 647833657
This turns the uint64 metric constructor arguments into a struct, making it
more explicit as to what each part means. It also allows the creation of
non-cumulative uint64 (gauge) metrics, and adds methods to decrement or set
them.
PiperOrigin-RevId: 647134245
There are 2 interfaces in gVisor which are exactly the same:
- pkg/tcpip/stack.UniqueID
- pkg/sentry/uniqueid.Provider
Before this change, both were using the Kernel as the unique number generator.
However, we want to decouple the netstack from the kernel. This coupling is
causing bugs in restore because netstack needs to be created before the Kernel
is restored. So right now, netstack ends up using a "temporary" Kernel which is
later destroyed in the restore sequence, but netstack keeps referencing it.
Before this change, the unique ID generator in pkg/tcpip/stack.Stack was used
for 2 things:
1. Provide NIC IDs which are unique across all network namespaces.
2. Implement stack.TransportEndpoint.UniqueID.
(2) is not used anywhere, so deleted it. (1) is overly unique. NIC IDs do not
need to be unique across network namespace. So instead of holding a pointer to
the kernel, added a NIC ID generator in stack.Stack itself and added
NextNICID() function with proper typing.
PiperOrigin-RevId: 646997006
Implement the core part. All packets are broadcast-ed to all ports. The next
step will be to implement forwarding and multicast group databases.
PiperOrigin-RevId: 644471256
The veth devices are virtual Ethernet devices. They can act as
tunnels between network namespaces to create a bridge to a
physical network device in another namespace, but can also be
used as standalone network devices.
More information can be found here:
https://man7.org/linux/man-pages/man4/veth.4.html
PiperOrigin-RevId: 638853289
TCP_INFO option is supported in gVisor, but does not return all the fields
in struct TCP_INFO. The fields which were required for debugging are added.
The support for other fields in the struct can be added when required.
PiperOrigin-RevId: 632621246
The NEWLINK commands contains many properties and here is no reason to have
another abstract interface between the Sentry and network stacks.
PiperOrigin-RevId: 627916629
Resume method resumes the endpoints after save which is required for
save/resume. This method resumes the endpoint states which were frozen during
save.
PiperOrigin-RevId: 615467468
This allows for external information to be passed to restore code.
Similar to c087777e37 ("Plumb restore context to afterLoad()").
Updates #1956.
PiperOrigin-RevId: 614125262
The existing Resume method in netstack is doing the work of Restore. This
method does not resume endpoints as the resumable endpoints are only stored
during the Restore of the sandbox, rename the method appropriately.
PiperOrigin-RevId: 613320887
SO_ACCEPTCONN returns true for TCP sockets which are in a listening state.
Added this socket option support for unix sockets.
PiperOrigin-RevId: 577008617