Skip to content

Commit

Permalink
Merge pull request networkservicemesh#412 from Nordix/411
Browse files Browse the repository at this point in the history
Fix MAC address update based on Ethernet context for kernel mechanism...
  • Loading branch information
edwarnicke authored Jan 24, 2022
2 parents 2292537 + 1fd80eb commit 500ed31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/kernel/networkservice/ethernetcontext/vf_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package ethernetcontext

import (
"bytes"
"context"
"net"
"time"
Expand Down Expand Up @@ -63,6 +64,9 @@ func setKernelHwAddress(ctx context.Context, conn *networkservice.Connection, is
if err != nil {
return errors.Wrapf(err, "invalid MAC address: %v", macAddrString)
}
if bytes.Equal([]byte(macAddr), []byte(l.Attrs().HardwareAddr)) {
return nil
}
if err = netlinkHandle.LinkSetDown(l); err != nil {
return errors.WithStack(err)
}
Expand Down

0 comments on commit 500ed31

Please sign in to comment.