diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-05-28 07:36:13 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-05-28 07:36:13 +0900 |
commit | 1e360ff7f5afca5bdaab04acd3a5ce8398cd5003 (patch) | |
tree | 1adec571be61a83d7746385424177c7fafa62029 /config | |
parent | 70434c96d21adef5b71041297009e60e89c91b45 (diff) |
config: fix misuse of pointers
Equal method for map misuses a pointer; all the entry of the map
becomes idential.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'config')
-rw-r--r-- | config/bgp_configs.go | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index 16968123..0b5297d1 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -1489,8 +1489,8 @@ func (lhs *PeerGroup) Equal(rhs *PeerGroup) bool { } { lmap := make(map[string]*AfiSafi) - for _, l := range lhs.AfiSafis { - lmap[string(l.Config.AfiSafiName)] = &l + for i, l := range lhs.AfiSafis { + lmap[string(l.Config.AfiSafiName)] = &lhs.AfiSafis[i] } for _, r := range rhs.AfiSafis { if l, y := lmap[string(r.Config.AfiSafiName)]; !y { @@ -2575,8 +2575,8 @@ func (lhs *Neighbor) Equal(rhs *Neighbor) bool { } { lmap := make(map[string]*AfiSafi) - for _, l := range lhs.AfiSafis { - lmap[string(l.Config.AfiSafiName)] = &l + for i, l := range lhs.AfiSafis { + lmap[string(l.Config.AfiSafiName)] = &lhs.AfiSafis[i] } for _, r := range rhs.AfiSafis { if l, y := lmap[string(r.Config.AfiSafiName)]; !y { @@ -4032,8 +4032,8 @@ func (lhs *Global) Equal(rhs *Global) bool { } { lmap := make(map[string]*AfiSafi) - for _, l := range lhs.AfiSafis { - lmap[string(l.Config.AfiSafiName)] = &l + for i, l := range lhs.AfiSafis { + lmap[string(l.Config.AfiSafiName)] = &lhs.AfiSafis[i] } for _, r := range rhs.AfiSafis { if l, y := lmap[string(r.Config.AfiSafiName)]; !y { @@ -4084,8 +4084,8 @@ func (lhs *Bgp) Equal(rhs *Bgp) bool { } { lmap := make(map[string]*Neighbor) - for _, l := range lhs.Neighbors { - lmap[string(l.Config.NeighborAddress)] = &l + for i, l := range lhs.Neighbors { + lmap[string(l.Config.NeighborAddress)] = &lhs.Neighbors[i] } for _, r := range rhs.Neighbors { if l, y := lmap[string(r.Config.NeighborAddress)]; !y { @@ -4100,8 +4100,8 @@ func (lhs *Bgp) Equal(rhs *Bgp) bool { } { lmap := make(map[string]*PeerGroup) - for _, l := range lhs.PeerGroups { - lmap[string(l.Config.PeerGroupName)] = &l + for i, l := range lhs.PeerGroups { + lmap[string(l.Config.PeerGroupName)] = &lhs.PeerGroups[i] } for _, r := range rhs.PeerGroups { if l, y := lmap[string(r.Config.PeerGroupName)]; !y { @@ -4116,8 +4116,8 @@ func (lhs *Bgp) Equal(rhs *Bgp) bool { } { lmap := make(map[string]*RpkiServer) - for _, l := range lhs.RpkiServers { - lmap[string(l.Config.Address)] = &l + for i, l := range lhs.RpkiServers { + lmap[string(l.Config.Address)] = &lhs.RpkiServers[i] } for _, r := range rhs.RpkiServers { if l, y := lmap[string(r.Config.Address)]; !y { @@ -4132,8 +4132,8 @@ func (lhs *Bgp) Equal(rhs *Bgp) bool { } { lmap := make(map[string]*BmpServer) - for _, l := range lhs.BmpServers { - lmap[string(l.Config.Address)] = &l + for i, l := range lhs.BmpServers { + lmap[string(l.Config.Address)] = &lhs.BmpServers[i] } for _, r := range rhs.BmpServers { if l, y := lmap[string(r.Config.Address)]; !y { @@ -4148,8 +4148,8 @@ func (lhs *Bgp) Equal(rhs *Bgp) bool { } { lmap := make(map[string]*Mrt) - for _, l := range lhs.MrtDump { - lmap[string(l.FileName)] = &l + for i, l := range lhs.MrtDump { + lmap[string(l.FileName)] = &lhs.MrtDump[i] } for _, r := range rhs.MrtDump { if l, y := lmap[string(r.FileName)]; !y { @@ -4752,8 +4752,8 @@ func (lhs *PolicyDefinition) Equal(rhs *PolicyDefinition) bool { } { lmap := make(map[string]*Statement) - for _, l := range lhs.Statements { - lmap[string(l.Name)] = &l + for i, l := range lhs.Statements { + lmap[string(l.Name)] = &lhs.Statements[i] } for _, r := range rhs.Statements { if l, y := lmap[string(r.Name)]; !y { @@ -4863,8 +4863,8 @@ func (lhs *BgpDefinedSets) Equal(rhs *BgpDefinedSets) bool { } { lmap := make(map[string]*CommunitySet) - for _, l := range lhs.CommunitySets { - lmap[string(l.CommunitySetName)] = &l + for i, l := range lhs.CommunitySets { + lmap[string(l.CommunitySetName)] = &lhs.CommunitySets[i] } for _, r := range rhs.CommunitySets { if l, y := lmap[string(r.CommunitySetName)]; !y { @@ -4879,8 +4879,8 @@ func (lhs *BgpDefinedSets) Equal(rhs *BgpDefinedSets) bool { } { lmap := make(map[string]*ExtCommunitySet) - for _, l := range lhs.ExtCommunitySets { - lmap[string(l.ExtCommunitySetName)] = &l + for i, l := range lhs.ExtCommunitySets { + lmap[string(l.ExtCommunitySetName)] = &lhs.ExtCommunitySets[i] } for _, r := range rhs.ExtCommunitySets { if l, y := lmap[string(r.ExtCommunitySetName)]; !y { @@ -4895,8 +4895,8 @@ func (lhs *BgpDefinedSets) Equal(rhs *BgpDefinedSets) bool { } { lmap := make(map[string]*AsPathSet) - for _, l := range lhs.AsPathSets { - lmap[string(l.AsPathSetName)] = &l + for i, l := range lhs.AsPathSets { + lmap[string(l.AsPathSetName)] = &lhs.AsPathSets[i] } for _, r := range rhs.AsPathSets { if l, y := lmap[string(r.AsPathSetName)]; !y { @@ -4945,8 +4945,8 @@ func (lhs *TagSet) Equal(rhs *TagSet) bool { } { lmap := make(map[string]*Tag) - for _, l := range lhs.TagList { - lmap[string(l.Value)] = &l + for i, l := range lhs.TagList { + lmap[string(l.Value)] = &lhs.TagList[i] } for _, r := range rhs.TagList { if l, y := lmap[string(r.Value)]; !y { @@ -5028,8 +5028,8 @@ func (lhs *PrefixSet) Equal(rhs *PrefixSet) bool { } { lmap := make(map[string]*Prefix) - for _, l := range lhs.PrefixList { - lmap[string(l.IpPrefix+l.MasklengthRange)] = &l + for i, l := range lhs.PrefixList { + lmap[string(l.IpPrefix+l.MasklengthRange)] = &lhs.PrefixList[i] } for _, r := range rhs.PrefixList { if l, y := lmap[string(r.IpPrefix+r.MasklengthRange)]; !y { @@ -5063,8 +5063,8 @@ func (lhs *DefinedSets) Equal(rhs *DefinedSets) bool { } { lmap := make(map[string]*PrefixSet) - for _, l := range lhs.PrefixSets { - lmap[string(l.PrefixSetName)] = &l + for i, l := range lhs.PrefixSets { + lmap[string(l.PrefixSetName)] = &lhs.PrefixSets[i] } for _, r := range rhs.PrefixSets { if l, y := lmap[string(r.PrefixSetName)]; !y { @@ -5079,8 +5079,8 @@ func (lhs *DefinedSets) Equal(rhs *DefinedSets) bool { } { lmap := make(map[string]*NeighborSet) - for _, l := range lhs.NeighborSets { - lmap[string(l.NeighborSetName)] = &l + for i, l := range lhs.NeighborSets { + lmap[string(l.NeighborSetName)] = &lhs.NeighborSets[i] } for _, r := range rhs.NeighborSets { if l, y := lmap[string(r.NeighborSetName)]; !y { @@ -5095,8 +5095,8 @@ func (lhs *DefinedSets) Equal(rhs *DefinedSets) bool { } { lmap := make(map[string]*TagSet) - for _, l := range lhs.TagSets { - lmap[string(l.TagSetName)] = &l + for i, l := range lhs.TagSets { + lmap[string(l.TagSetName)] = &lhs.TagSets[i] } for _, r := range rhs.TagSets { if l, y := lmap[string(r.TagSetName)]; !y { @@ -5132,8 +5132,8 @@ func (lhs *RoutingPolicy) Equal(rhs *RoutingPolicy) bool { } { lmap := make(map[string]*PolicyDefinition) - for _, l := range lhs.PolicyDefinitions { - lmap[string(l.Name)] = &l + for i, l := range lhs.PolicyDefinitions { + lmap[string(l.Name)] = &lhs.PolicyDefinitions[i] } for _, r := range rhs.PolicyDefinitions { if l, y := lmap[string(r.Name)]; !y { |