Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ksubrmnn committed Jan 3, 2019
1 parent 5c142c2 commit 839706b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backend/vxlan/vxlan_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,11 @@ func (be *VXLANBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup,
}

var remoteDrMac string
for _, hnsnetwork := range hnsNetworks {
for _, hnsNetwork := range hnsNetworks {
log.Infof("Checking HNS network for DR MAC : [%+v]", hnsNetwork)
if len(remoteDrMac) == 0 {
var providerAddress string
for _, policy := range hnsnetwork.Policies {
for _, policy := range hnsNetwork.Policies {
if policy.Type == hcn.DrMacAddress {
policySettings := hcn.DrMacAddressNetworkPolicySetting{}
err = json.Unmarshal(policy.Settings, &policySettings)
Expand All @@ -150,13 +151,14 @@ func (be *VXLANBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup,
}
}
if providerAddress != be.extIface.ExtAddr.String() {
log.Infof("Cannot use DR MAC %v since PA %v does not match %v", remoteDrMac, providerAddress, be.extIface.ExtAddr.String())
remoteDrMac = ""
}
}
}
mac, err := net.ParseMAC(string(remoteDrMac))
if err != nil {
return nil, err
return nil, fmt.Errorf("Cannot parse DR MAC %v: %+v", remoteDrMac, err)
}
subnetAttrs, err := newSubnetAttrs(be.extIface.ExtAddr, uint16(cfg.VNI), mac)
if err != nil {
Expand Down

0 comments on commit 839706b

Please sign in to comment.