Skip to content

Commit 3f9b993

Browse files
authored
prevent incomplete MAC address from spamming logs (#1473)
1 parent c3f3f42 commit 3f9b993

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scenarios/aws/microVMs/microvms/network.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ func parseArpDhcpLeases() ([]dhcpLease, error) {
259259
fmt.Printf("warning: error parsing arp line: %v\n", err)
260260
continue
261261
}
262+
if lease.mac == "" {
263+
continue
264+
}
262265

263266
leases = append(leases, lease)
264267
}
@@ -275,6 +278,10 @@ func parseArpLine(line string) (dhcpLease, error) {
275278
}
276279

277280
ip := strings.Trim(parts[1], "()")
281+
if parts[3] == "(incomplete)" {
282+
return dhcpLease{}, nil
283+
}
284+
278285
mac, err := normalizeMAC(parts[3])
279286
if err != nil {
280287
return dhcpLease{}, fmt.Errorf("error normalizing MAC address: %w", err)

0 commit comments

Comments
 (0)