Improved default peer handling (#674)
Some checks are pending
Docker / Build and Push (push) Waiting to run
Docker / release (push) Blocked by required conditions
github-pages / deploy (push) Waiting to run

* create default peers for newly created interfaces (#666)

* allow to manually create default peers for an interface (#666)
This commit is contained in:
h44z
2026-04-16 21:55:41 +02:00
committed by GitHub
parent 51e4c0ebf1
commit 1c133b6f6e
31 changed files with 658 additions and 336 deletions

View File

@@ -240,6 +240,18 @@ func (i *Interface) GetRoutingTable() int {
}
}
// CreateDefaultPeers determines whether default peers should be created for this interface.
func (i *Interface) CreateDefaultPeers() bool {
if !i.CreateDefaultPeer {
return false // only create default peers if the interface flag is set
}
if i.Type != InterfaceTypeServer {
return false // only create default peers for server interfaces
}
return true
}
type PhysicalInterface struct {
Identifier InterfaceIdentifier // device name, for example: wg0
KeyPair // private/public Key of the server interface