1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 15:24:32 +00:00

Add a network test that sets up 2 of 4 ehternet devices, and allows another to use dhcp

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-03-10 21:53:12 +10:00
parent 00af8545d6
commit 17b3589782
56 changed files with 5092 additions and 792 deletions

View File

@@ -10,9 +10,11 @@ import (
// include a mask, so it stores the address as a net.IPNet.
type Addr struct {
*net.IPNet
Label string
Flags int
Scope int
Label string
Flags int
Scope int
Peer *net.IPNet
Broadcast net.IP
}
// String returns $ip/$netmask $label
@@ -43,3 +45,10 @@ func (a Addr) Equal(x Addr) bool {
// ignore label for comparison
return a.IP.Equal(x.IP) && sizea == sizeb
}
func (a Addr) PeerEqual(x Addr) bool {
sizea, _ := a.Peer.Mask.Size()
sizeb, _ := x.Peer.Mask.Size()
// ignore label for comparison
return a.Peer.IP.Equal(x.Peer.IP) && sizea == sizeb
}