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

Commit 1429aa8

Browse files
committed
network: adding support for network on packet type3 hw
1 parent fac805d commit 1429aa8

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
@@ -98,33 +98,21 @@ func parseNetwork(netdata packet.NetworkData, nameservers []net.IP) ([]Interface
9898
},
9999
}
100100

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

122-
if iface.Name == "enp1s0f0" {
123-
p.configDepth = 20
124-
}
103+
for index, iface := range netdata.Interfaces {
104+
bond.slaves = append(bond.slaves, iface.Name)
125105

126-
interfaces = append(interfaces, &p)
127-
}
106+
interfaces = append(interfaces, &physicalInterface{
107+
logicalInterface: logicalInterface{
108+
name: iface.Name,
109+
config: configMethodStatic{
110+
nameservers: nameservers,
111+
},
112+
children: []networkInterface{&bond},
113+
configDepth: index,
114+
},
115+
})
128116
}
129117

130118
interfaces = append(interfaces, &bond)

0 commit comments

Comments
 (0)