We are now using a custom kernel not unmodified upstream, so
best to identify it.
Also fix https://github.com/docker/pinata/issues/2153
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This is simpler, and as a by-product should resolve
https://github.com/docker/pinata/issues/1968
as it uses the now-more-correct loop device names
that newer util-linux expects.
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
- the initial length field should be the total length of the whole
frame including the variable length field and including the length
field
- when unmarshalling, return the number of bytes of payload actually
unmarshalled and not the size of the unmarshal buffer
Signed-off-by: David Scott <dave.scott@docker.com>
The 9P operations tell the host to connect to the vsock port in the
UDP case, so always listen before sending the 9P request.
Signed-off-by: David Scott <dave.scott@docker.com>
Since the header is variable length it's useful to write a length
field first, so the peer can read the rest of the packet as a block.
Signed-off-by: David Scott <dave.scott@docker.com>
A net.UDPListener is the datagram equivalent of a net.Conn. This patch
accepts at most one connection from vsock and attempts to read and write
UDP datagrams along it.
Signed-off-by: David Scott <dave.scott@docker.com>
This represents what is needed from the frontend side of the proxy:
- the ability to receive a UDP datagram and know who it is from
- the ability to send a UDP datagram to a particular destination
- the ability to close
Signed-off-by: David Scott <dave.scott@docker.com>
The proxy process command-line arguments assume we're exposing TCP
or UDP ports on Moby's public IPs. Instead we're forwarding over vsock
where we must map the Moby ports onto vsock ports. Normally TCP and
UDP ports are different, but with vsock there is only one space of
port numbers so we have to map them into different ranges.
This patch maps Moby ports as follows:
- TCP port x onto vsock port 0x10000 + x
- UDP port x onto vsock port 0x20000 + x
Signed-off-by: David Scott <dave.scott@docker.com>
Using 23a432c2-537a-4291-bcb5-d62504644739 as the GUID (randomly generated).
The Windows host side will uses this as service ID, once written.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
Also tidy up some of the coding style to be more Linux kernel style
which most of the code already was.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
The NIC with the lowest metric is used for routing, while the NIC with
the highest index is used for DNS. Set the metric of eth1 to 199, so it
is higher-priority than eth0, so we use eth1 for everything in a dual
NIC configuration.
Signed-off-by: David Scott <dave.scott@docker.com>
Normally we advertise $(hostname).local. by MDNS on eth0. If the new
"hybrid" networking mode is configured, we will use 2 NICs and eth1
will be connected via vmnet, and so we should run MDNS on it.
Signed-off-by: David Scott <dave.scott@docker.com>
This makes it possible to have one NIC controlled by vmnet and another
controlled by slirp.
If eth1 doesn't exist then a harmless message is generated during
bootup: (with no appreciable delay)
* Starting networking ... * lo ... [ ok ]
* eth0 ... [ ok ]
* eth1 ...ip: ioctl 0x8913 failed: No such device
[ !! ]
Signed-off-by: David Scott <dave.scott@docker.com>
Wrap a EFI stub loader with vmlinuz, initrd, and a short commandline
inside a single EFI binary.
Two files are generated:
- mobylinux.efi is a raw EFI file which some hypervisors can boot directly
- mobylinux-efi.iso: ISO image with just MobyLinux in the EFI partition
also:
- rename legacy BIOS mobylinux.iso to mobylinux-bios.iso
- Build mobylinux-efi.iso as part of the standard mobylinux build
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This seems to be a difference between the AF_VSOCK and AF_INET
implementations. We work around it by exiting the proxy process
immediately, which will clean up resources anyway.
Signed-off-by: David Scott <dave.scott@docker.com>
- don't try to create a `FileConn` because the Go library sees through
the scam and rejects it
- explicitly keep a reference to the `ctl` file just in case the GC
decides its dead and should be closed.
Signed-off-by: David Scott <dave.scott@docker.com>
The port will be automatically removed when the fd/fid is closed by
a process exit/crash, or by a hypervisor crash.
Signed-off-by: David Scott <dave.scott@docker.com>