patchpanel: ndproxy: assign public v6 addr to guest-facing ifs
Currently there is no public IPv6 address assigned on the
guest-facing interfaces (arc bridges and taps) when device is on
IPv6 network. This is causing Linux choosing a wrong src address
on packets directly originated from host to guest and drop the
returning traffic.
This patch generates an EUI-64 address based on virtual interface
MAC address upon receiving an RA, and add it to the interface.
BUG=chromium:1069985
TEST=unit;fuzz
TEST=manual(deploy on octopus and verify pinging penguin from host)
Change-Id: Id3ae953df6b3c84411461294bbc8dbd236cef901
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2428652
Tested-by: Taoyu Li <taoyl@chromium.org>
Reviewed-by: Garrick Evans <garrick@chromium.org>
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
Commit-Queue: Taoyu Li <taoyl@chromium.org>
diff --git a/patchpanel/datapath.h b/patchpanel/datapath.h
index 9b6b498..b0337e1 100644
--- a/patchpanel/datapath.h
+++ b/patchpanel/datapath.h
@@ -25,7 +25,7 @@
NONE = 0,
IPv4 = 1 << 0,
IPv6 = 1 << 1,
- Dual = IPv4 | IPv6, //(1 << 0) | (1 << 1);
+ Dual = IPv4 | IPv6, // (1 << 0) | (1 << 1);
};
// cros lint will yell to force using int16/int64 instead of long here, however
@@ -205,10 +205,10 @@
const std::string& ipv6_addr,
int ipv6_prefix_len);
- virtual bool AddIPv6Neighbor(const std::string& ifname,
- const std::string& ipv6_addr);
- virtual void RemoveIPv6Neighbor(const std::string& ifname,
- const std::string& ipv6_addr);
+ virtual bool AddIPv6Address(const std::string& ifname,
+ const std::string& ipv6_addr);
+ virtual void RemoveIPv6Address(const std::string& ifname,
+ const std::string& ipv6_addr);
// Adds (or deletes) a route to direct to |gateway_addr| the traffic destined
// to the subnet defined by |addr| and |netmask|.
@@ -257,7 +257,7 @@
Firewall* firewall_;
ioctl_t ioctl_;
- bool ModifyRtentry(unsigned long op, struct rtentry* route);
+ bool ModifyRtentry(ioctl_req_t op, struct rtentry* route);
DISALLOW_COPY_AND_ASSIGN(Datapath);
};