Skip to content
This repository was archived by the owner on Sep 18, 2020. It is now read-only.

Commit 08eb9ba

Browse files
committed
Merge pull request #363 from packethost/add-type3-network
Added type3 iface
2 parents fa0178c + 1429aa8 commit 08eb9ba

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

network/packet.go

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -92,33 +92,21 @@ func parseNetwork(netdata packet.NetworkData, nameservers []net.IP) ([]Interface
9292
},
9393
}
9494

95-
for _, iface := range netdata.Interfaces {
96-
if iface.Name != "chassis0" && iface.Name != "ipmi0" {
97-
bond.slaves = append(bond.slaves, iface.Name)
98-
if iface.Name == "enp1s0f0" {
99-
bond.hwaddr, _ = net.ParseMAC(iface.Mac)
100-
}
101-
}
102-
}
103-
104-
for _, iface := range netdata.Interfaces {
105-
if iface.Name != "chassis0" && iface.Name != "ipmi0" {
106-
p := physicalInterface{
107-
logicalInterface: logicalInterface{
108-
name: iface.Name,
109-
config: configMethodStatic{
110-
nameservers: nameservers,
111-
},
112-
children: []networkInterface{&bond},
113-
},
114-
}
95+
bond.hwaddr, _ = net.ParseMAC(netdata.Interfaces[0].Mac)
11596

116-
if iface.Name == "enp1s0f0" {
117-
p.configDepth = 20
118-
}
97+
for index, iface := range netdata.Interfaces {
98+
bond.slaves = append(bond.slaves, iface.Name)
11999

120-
interfaces = append(interfaces, &p)
121-
}
100+
interfaces = append(interfaces, &physicalInterface{
101+
logicalInterface: logicalInterface{
102+
name: iface.Name,
103+
config: configMethodStatic{
104+
nameservers: nameservers,
105+
},
106+
children: []networkInterface{&bond},
107+
configDepth: index,
108+
},
109+
})
122110
}
123111

124112
interfaces = append(interfaces, &bond)

0 commit comments

Comments
 (0)