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>
The `NewProxy` function already knows how to deal with `net.UDPAddr`
and `net.TCPAddr`, this patch adds similar support for `vsock.VsockAddr`.
Signed-off-by: David Scott <dave.scott@docker.com>
This patch adds a wrapper around the `net.Conn` to include the
`CloseRead` and `CloseWrite` implementations. This patch also
exposes the `VsockAddr` type, which is similar to `TCPAddr` and
`UDPAddr`.
Signed-off-by: David Scott <dave.scott@docker.com>
We require the frontend to be a `net.Listener` and the `net.Conn`
connection which are established must be type-switched to
`Conn` to support the `CloseRead` and `CloseWrite` methods.
Signed-off-by: David Scott <dave.scott@docker.com>
The TCPProxy can proxy from anything which satisfies this interface:
type Conn interface {
io.Reader
io.Writer
io.Closer
CloseRead() error
CloseWrite() error
}
Signed-off-by: David Scott <dave.scott@docker.com>
This package supports a more normal Go interface, in particular it has:
// Listen returns a net.Listener which can accept connections on the given
// vhan port.
func Listen(port uint) (net.Listener, error)
Signed-off-by: David Scott <dave.scott@docker.com>
Note there is a slight name clash between the final binary 'proxy'
and the library formerly known as 'proxy'. Resolve this by calling
the library 'libproxy'.
Signed-off-by: David Scott <dave.scott@docker.com>
- Trigger a CIFS mount by writing to the "cifsmount" key.
- The value has the format: <mountpoint>;<alias mountpoint>;<options>
with <options> containing username, password and optional domain
- The key is not stored in the KV store (aka the 'registry')
- Trigger an unmount by writing to the cifsumount" key.
- The value has the format: <mountpoint>;<alias mountpoint>
- The 'registry' is also wiped on reboot
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This will make it easier to add a vsock interface as well as a regular
TCP/IP one.
As a side-effect, the server is now able to handle more than one concurrent
request!
Signed-off-by: David Scott <dave.scott@docker.com>