mirror of
https://github.com/h44z/wg-portal.git
synced 2026-04-17 13:06:21 +00:00
create default peers for newly created interfaces (#666)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user