summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/network.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-11-02 14:30:13 -0700
committergVisor bot <gvisor-bot@google.com>2021-11-02 14:30:13 -0700
commit3141bf7a245795969685e7f7f4ef09a0dcde19f8 (patch)
treee08b9570b2f05ba6a187b03475f7a23bddde39f9 /runsc/boot/network.go
parentea792cb3e1b3c1f2c34b2ffd7dbfde5d935b8a74 (diff)
parenta0849e657836cc76fc94e09bcae0755944b46a5c (diff)
Merge pull request #6803 from pkit:pkit/copy_arp
PiperOrigin-RevId: 407177936
Diffstat (limited to 'runsc/boot/network.go')
-rw-r--r--runsc/boot/network.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/runsc/boot/network.go b/runsc/boot/network.go
index 9fb3ebd95..f819cf8fb 100644
--- a/runsc/boot/network.go
+++ b/runsc/boot/network.go
@@ -78,6 +78,11 @@ type DefaultRoute struct {
Name string
}
+type Neighbor struct {
+ IP net.IP
+ HardwareAddr net.HardwareAddr
+}
+
// FDBasedLink configures an fd-based link.
type FDBasedLink struct {
Name string
@@ -90,6 +95,7 @@ type FDBasedLink struct {
RXChecksumOffload bool
LinkAddress net.HardwareAddr
QDisc config.QueueingDiscipline
+ Neighbors []Neighbor
// NumChannels controls how many underlying FD's are to be used to
// create this endpoint.
@@ -241,6 +247,11 @@ func (n *Network) CreateLinksAndRoutes(args *CreateLinksAndRoutesArgs, _ *struct
}
routes = append(routes, route)
}
+
+ for _, neigh := range link.Neighbors {
+ proto, tcpipAddr := ipToAddressAndProto(neigh.IP)
+ n.Stack.AddStaticNeighbor(nicID, proto, tcpipAddr, tcpip.LinkAddress(neigh.HardwareAddr))
+ }
}
if !args.Defaultv4Gateway.Route.Empty() {