Skip to content

Commit

Permalink
network: Fix error message for setting hardware address on TAP interface
Browse files Browse the repository at this point in the history
Error out with the correct interface name and hardware address instead.

Fixes: #4944

Signed-off-by: Hengqi Chen <chenhengqi@outlook.com>
  • Loading branch information
chenhengqi committed Aug 17, 2022
1 parent 8cd1e50 commit 8ff5c10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/virtcontainers/network_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ func tapNetworkPair(ctx context.Context, endpoint Endpoint, queues int, disableV
}

if err := netHandle.LinkSetHardwareAddr(tapLink, tapHardAddr); err != nil {
return fmt.Errorf("Could not set MAC address %s for veth interface %s: %s",
netPair.VirtIface.HardAddr, netPair.VirtIface.Name, err)
return fmt.Errorf("Could not set MAC address %s for TAP interface %s: %s",
netPair.TAPIface.HardAddr, netPair.TAPIface.Name, err)
}

if err := netHandle.LinkSetUp(tapLink); err != nil {
Expand Down

0 comments on commit 8ff5c10

Please sign in to comment.