|
|
@ -205,14 +205,11 @@ func (r *Ring) AddPeer(p *Machine) bool { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (r *Ring) setRingZeroAllowedIPs(rp *RingPeer) { |
|
|
|
func (r *Ring) setRingZeroAllowedIPs(rp *RingPeer) { |
|
|
|
regionID, zoneID, _, _ := r.Decode(rp.Address) |
|
|
|
// ring0 peer
|
|
|
|
|
|
|
|
|
|
|
|
// everyone on ring0 is a gateway to ring1
|
|
|
|
|
|
|
|
subnet, _ := rings.RingOnePrefix(regionID, zoneID) |
|
|
|
|
|
|
|
rp.AllowSubnet(subnet) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// peer
|
|
|
|
|
|
|
|
rp.AllowCIDR(rp.Address, 32) |
|
|
|
rp.AllowCIDR(rp.Address, 32) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// everyone on ring0 has a leg on ring1
|
|
|
|
|
|
|
|
rp.AllowCIDR(rp.Node.RingOneAddress(), 32) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (r *Ring) setRingOneGatewayAllowedIPs(rp *RingPeer) { |
|
|
|
func (r *Ring) setRingOneGatewayAllowedIPs(rp *RingPeer) { |
|
|
|