pkg/mesh: respect allowed location IPs in peers

Currently, when rendering the configuration for a Peer, the allowed
location configs of any segment are erroneously ignored, meaning that an
administrator will have to manually edit the configuration to get the
expected behavior from a Peer. This commit fixes the generation of the
configuration.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
This commit is contained in:
Lucas Servén Marín 2022-03-31 21:26:53 +02:00
parent 5de689ea1f
commit df8d2cb68f
No known key found for this signature in database
GPG Key ID: 586FEAF680DA74AD
1 changed files with 1 additions and 1 deletions

View File

@ -371,7 +371,7 @@ func (t *Topology) PeerConf(name string) *wireguard.Conf {
for _, s := range t.segments {
peer := wireguard.Peer{
PeerConfig: wgtypes.PeerConfig{
AllowedIPs: s.allowedIPs,
AllowedIPs: append(s.allowedIPs, s.allowedLocationIPs...),
PersistentKeepaliveInterval: pka,
PresharedKey: psk,
PublicKey: s.key,