diff --git a/pkg/pillar/cmd/zedmanager/handledomainmgr.go b/pkg/pillar/cmd/zedmanager/handledomainmgr.go index a000676d3c3..746e3becec2 100644 --- a/pkg/pillar/cmd/zedmanager/handledomainmgr.go +++ b/pkg/pillar/cmd/zedmanager/handledomainmgr.go @@ -117,9 +117,8 @@ func MaybeAddDomainConfig(ctx *zedmanagerContext, anaCount := len(ns.AppNetAdapterList) dc.VifList = make([]types.VifConfig, anaCount) - // Put UL before OL - for i, ul := range ns.AppNetAdapterList { - dc.VifList[i] = ul.VifInfo.VifConfig + for i, adapter := range ns.AppNetAdapterList { + dc.VifList[i] = adapter.VifInfo.VifConfig } } log.Functionf("MaybeAddDomainConfig done for %s", key) diff --git a/pkg/pillar/cmd/zedrouter/appnetwork.go b/pkg/pillar/cmd/zedrouter/appnetwork.go index 9c3508f758f..3d8065814d4 100644 --- a/pkg/pillar/cmd/zedrouter/appnetwork.go +++ b/pkg/pillar/cmd/zedrouter/appnetwork.go @@ -42,13 +42,13 @@ func (z *zedrouter) updateVIFsForStateCollecting( // Determine the set of affected network instances. var networks []uuid.UUID if prevAppConf != nil { - for _, ul := range prevAppConf.AppNetAdapterList { - networks = append(networks, ul.Network) + for _, adapter := range prevAppConf.AppNetAdapterList { + networks = append(networks, adapter.Network) } } if newAppConfig != nil { - for _, ul := range newAppConfig.AppNetAdapterList { - networks = append(networks, ul.Network) + for _, adapter := range newAppConfig.AppNetAdapterList { + networks = append(networks, adapter.Network) } } networks = generics.FilterDuplicates(networks) diff --git a/pkg/pillar/cmd/zedrouter/ipam.go b/pkg/pillar/cmd/zedrouter/ipam.go index 642bfe3d7bf..f7461289071 100644 --- a/pkg/pillar/cmd/zedrouter/ipam.go +++ b/pkg/pillar/cmd/zedrouter/ipam.go @@ -167,36 +167,36 @@ func (z *zedrouter) reloadStatusOfAssignedIPs(status *types.AppNetworkStatus) { adapterStatus := &status.AppNetAdapterList[i] allAddrs, _ := z.niStateCollector.GetIPAssignments(adapterStatus.Network) vifAddrs := allAddrs.LookupByAdapterName(status.UUIDandVersion.UUID, adapterStatus.Name) - z.recordAssignedIPsToULStatus(adapterStatus, vifAddrs) + z.recordAssignedIPsToAdapterStatus(adapterStatus, vifAddrs) } } -func (z *zedrouter) recordAssignedIPsToULStatus(ul *types.AppNetAdapterStatus, +func (z *zedrouter) recordAssignedIPsToAdapterStatus(adapter *types.AppNetAdapterStatus, vifAddrs *nistate.VIFAddrs) { if vifAddrs == nil { - z.removeAssignedIPsFromULStatus(ul) + z.removeAssignedIPsFromAdapterStatus(adapter) return } - ul.AllocatedIPv4Addr = vifAddrs.IPv4Addr - if !isEmptyIP(ul.AppIPAddr) && - !ul.AppIPAddr.Equal(ul.AllocatedIPv4Addr) { + adapter.AllocatedIPv4Addr = vifAddrs.IPv4Addr + if !isEmptyIP(adapter.AppIPAddr) && + !adapter.AppIPAddr.Equal(adapter.AllocatedIPv4Addr) { // Config and status do not match. - ul.IPAddrMisMatch = true + adapter.IPAddrMisMatch = true } else { - ul.IPAddrMisMatch = false + adapter.IPAddrMisMatch = false } - ul.AllocatedIPv6List = vifAddrs.IPv6Addrs - ul.IPv4Assigned = !isEmptyIP(vifAddrs.IPv4Addr) + adapter.AllocatedIPv6List = vifAddrs.IPv6Addrs + adapter.IPv4Assigned = !isEmptyIP(vifAddrs.IPv4Addr) } func (z *zedrouter) removeAssignedIPsFromAppNetStatus(status *types.AppNetworkStatus) { for i := range status.AppNetAdapterList { adapterStatus := &status.AppNetAdapterList[i] - z.removeAssignedIPsFromULStatus(adapterStatus) + z.removeAssignedIPsFromAdapterStatus(adapterStatus) } } -func (z *zedrouter) removeAssignedIPsFromULStatus(adapterStatus *types.AppNetAdapterStatus) { +func (z *zedrouter) removeAssignedIPsFromAdapterStatus(adapterStatus *types.AppNetAdapterStatus) { adapterStatus.AllocatedIPv6List = nil adapterStatus.AllocatedIPv4Addr = nil adapterStatus.IPAddrMisMatch = false diff --git a/pkg/pillar/cmd/zedrouter/validation.go b/pkg/pillar/cmd/zedrouter/validation.go index 97bbb804aeb..5d8ae15250f 100644 --- a/pkg/pillar/cmd/zedrouter/validation.go +++ b/pkg/pillar/cmd/zedrouter/validation.go @@ -248,13 +248,13 @@ func (z *zedrouter) checkForPortMapOverlap(adapterCfgList1 []types.AppNetAdapter for _, adapterCfg1 := range adapterCfgList1 { network1 := adapterCfg1.Network // Validate whether there are duplicate portmap rules within itself. - if z.detectPortMapConflictWithinUL(adapterCfg1.ACLs) { + if z.detectPortMapConflictWithinAdapter(adapterCfg1.ACLs) { return true } for _, adapterCfg2 := range adapterCfgList2 { network2 := adapterCfg2.Network if network1 == network2 || z.checkUplinkPortOverlap(network1, network2) { - if z.detectPortMapConflictAcrossULs(adapterCfg1.ACLs, adapterCfg2.ACLs) { + if z.detectPortMapConflictAcrossAdapters(adapterCfg1.ACLs, adapterCfg2.ACLs) { return true } } @@ -296,7 +296,7 @@ func appendError(allErrors string, prefix string, lasterr string) ( return fmt.Sprintf("%s%s: %s\n\n", allErrors, prefix, lasterr), true } -func (z *zedrouter) detectPortMapConflictWithinUL(ACLs []types.ACE) bool { +func (z *zedrouter) detectPortMapConflictWithinAdapter(ACLs []types.ACE) bool { matchTypes1 := []string{"protocol"} matchTypes2 := []string{"protocol", "lport"} idx1 := 0 @@ -338,7 +338,7 @@ func (z *zedrouter) detectPortMapConflictWithinUL(ACLs []types.ACE) bool { // Check for duplicate portmap rules in between two set of ACLs. // For this, we will match the protocol/lport being same. -func (z *zedrouter) detectPortMapConflictAcrossULs( +func (z *zedrouter) detectPortMapConflictAcrossAdapters( ACLs []types.ACE, ACLs1 []types.ACE) bool { matchTypes := []string{"protocol", "lport"} for _, ace1 := range ACLs { diff --git a/pkg/pillar/cmd/zedrouter/zedrouter.go b/pkg/pillar/cmd/zedrouter/zedrouter.go index ba07197fa49..ef1aa642cc8 100644 --- a/pkg/pillar/cmd/zedrouter/zedrouter.go +++ b/pkg/pillar/cmd/zedrouter/zedrouter.go @@ -475,7 +475,7 @@ func (z *zedrouter) run(ctx context.Context) (err error) { if adapterStatus.Name != vif.NetAdapterName { continue } - z.recordAssignedIPsToULStatus(adapterStatus, &newAddrs) + z.recordAssignedIPsToAdapterStatus(adapterStatus, &newAddrs) break } z.publishAppNetworkStatus(appStatus)