Since the passt/pasta guest and host (usually) have the same address,
it's not possible for the guest to address the host, which is a
serious limitation. So, passt/pasta NATs the address of the default
gateway to the host as a special case.
That can be quite limiting however. Most obviously this prevents the
guest from addressing the gateway, which is less common than needing
to address the host, but certainly possible. The combination of the
concepts of "gateway" and "nat to host" address makes for some extra
confusion as well.
This series separates the two concepts in both the code and the tests,
and adds a command line option for configuring the NAT to host address
explicitly (by default it remains the same as the gateway).
This isn't quite ready for merge yet. First, I think there might be a
bug I haven't managed to track down yet which causes intermittent
failures in some of the UDP throughput tests. Second, I don't think
we want to commit to this command line option just yet, without a look
at what further NAT cleanups we might want to do (which I'll be
looking at in the near term future).
David Gibson (7):
udp: Simplify setting of source IPv6 address for inbound packets
udp: Simplify setting od destination IPv6 address for inbound packets
nat: Split notion of gateway/router from from guest-visible host
address
nat: Simplify --no-map-gw handling
nat: Centralise handling of gateway versus link-local address for host
NAT
Allow nat-to-host addresses to be overridden
nat, test: Test --nat-to-host option
conf.c | 113 ++++++++++++++++++++++++++++++------------
dhcp.c | 14 +++---
dhcpv6.c | 4 +-
ndp.c | 4 +-
passt.h | 14 +++---
pasta.c | 4 +-
tcp.c | 17 +++----
test/lib/setup | 19 +++++--
test/lib/test | 12 +++++
test/passt/dhcp | 7 ++-
test/passt/tcp | 10 ++--
test/passt/udp | 5 +-
test/passt_in_ns/dhcp | 73 +++++++++++++++++++++++++++
test/passt_in_ns/tcp | 28 +++++------
test/passt_in_ns/udp | 14 +++---
test/pasta/tcp | 11 ++--
test/pasta/udp | 6 +--
test/perf/passt_tcp | 30 ++++++-----
test/perf/passt_udp | 26 +++++-----
test/perf/pasta_tcp | 26 +++++-----
test/perf/pasta_udp | 22 ++++----
test/run | 4 +-
test/two_guests/basic | 10 ++--
udp.c | 41 ++++++---------
24 files changed, 313 insertions(+), 201 deletions(-)
create mode 100644 test/passt_in_ns/dhcp
--
2.40.1