Refactor OpenVPN and OpenConnect endpoints
This commit is contained in:
@@ -24,6 +24,8 @@ func newSystemStackDevice(options DeviceOptions) (*systemStackDevice, error) {
|
||||
}
|
||||
stackOptions := options
|
||||
stackOptions.System = false
|
||||
stackOptions.Name = system.options.Name
|
||||
stackOptions.ExcludeInterface = []string{system.options.Name}
|
||||
stackDevice, err := newStackDevice(stackOptions)
|
||||
if err != nil {
|
||||
system.Close()
|
||||
@@ -41,6 +43,15 @@ func (d *systemStackDevice) SetPacketWriter(writer PacketWriter) {
|
||||
d.stackDevice.SetPacketWriter(writer)
|
||||
}
|
||||
|
||||
func (d *systemStackDevice) Start() error {
|
||||
err := d.stackDevice.Start()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = d.systemDevice.Start()
|
||||
return err
|
||||
}
|
||||
|
||||
func (d *systemStackDevice) UpdateConfiguration(configuration Configuration) error {
|
||||
err := d.systemDevice.UpdateConfiguration(configuration)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user