Skip to content

Commit

Permalink
sdn: fix network-already-set-up detection
Browse files Browse the repository at this point in the history
Due to a misguided attempt to harmonize addresses and routes
checking in alreadySetUp().  Turns out addresses can simply be
checked for equality since they are returned from GetAddresses()
as plain CIDRs, but routes need the extra " " in the check because
the entire '/sbin/ip route' line is returned.

Fixes: #11082
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1388856
  • Loading branch information
dcbw committed Oct 28, 2016
1 parent 139357c commit deaf7b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sdn/plugin/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (plugin *OsdnNode) alreadySetUp(localSubnetGatewayCIDR, clusterNetworkCIDR
}
found = false
for _, addr := range addrs {
if strings.Contains(addr, localSubnetGatewayCIDR+" ") {
if strings.Contains(addr, localSubnetGatewayCIDR) {
found = true
break
}
Expand Down

0 comments on commit deaf7b0

Please sign in to comment.