Merge pull request #115 from leonnicolas/bug_encapsulation
pkg/mesh/mesh.go: iptables rules in encapsulation
This commit is contained in:
commit
afea50a388
@ -490,7 +490,10 @@ func (m *Mesh) applyTopology() {
|
|||||||
if m.enc.Strategy() != encapsulation.Never && m.local {
|
if m.enc.Strategy() != encapsulation.Never && m.local {
|
||||||
var cidrs []*net.IPNet
|
var cidrs []*net.IPNet
|
||||||
for _, s := range t.segments {
|
for _, s := range t.segments {
|
||||||
if s.location == nodes[m.hostname].Location {
|
// If the location prefix is not logicalLocation, but nodeLocation,
|
||||||
|
// we don't need to set any extra rules for encapsulation anyways
|
||||||
|
// because traffic will go over WireGuard.
|
||||||
|
if s.location == logicalLocationPrefix+nodes[m.hostname].Location {
|
||||||
for i := range s.privateIPs {
|
for i := range s.privateIPs {
|
||||||
cidrs = append(cidrs, oneAddressCIDR(s.privateIPs[i]))
|
cidrs = append(cidrs, oneAddressCIDR(s.privateIPs[i]))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user