Merge pull request #310 from jfrazelle/9771-non-local-mac-address

Allow non local mac-address.
This commit is contained in:
Rohit Jnagal 2014-12-22 23:03:42 -08:00
commit 9455a8ce3a
1 changed files with 2 additions and 3 deletions

View File

@ -522,11 +522,10 @@ func NetworkSetMacAddress(iface *net.Interface, macaddr string) error {
var ( var (
MULTICAST byte = 0x1 MULTICAST byte = 0x1
LOCALOUI byte = 0x2
) )
if hwaddr[0]&0x1 == MULTICAST || hwaddr[0]&0x2 != LOCALOUI { if hwaddr[0]&0x1 == MULTICAST {
return fmt.Errorf("Incorrect Local MAC Address specified: %s", macaddr) return fmt.Errorf("Multicast MAC Address is not supported: %s", macaddr)
} }
wb := newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK) wb := newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)