From 839706bdabfbb073040669a8ae490e2e18c7a312 Mon Sep 17 00:00:00 2001 From: ksubrmnn Date: Thu, 3 Jan 2019 15:08:41 -0800 Subject: [PATCH] Add logs --- backend/vxlan/vxlan_windows.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/vxlan/vxlan_windows.go b/backend/vxlan/vxlan_windows.go index 5f4c663b4e..a661d1b265 100644 --- a/backend/vxlan/vxlan_windows.go +++ b/backend/vxlan/vxlan_windows.go @@ -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) @@ -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 {