daemon: move more code from core.Interface to daemon.Interface

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2022-10-04 11:22:09 +02:00
parent eb57b4c357
commit b10c7f37ce
3 changed files with 43 additions and 16 deletions

View File

@@ -15,7 +15,6 @@ import (
"github.com/stv0g/cunicu/pkg/wg"
"go.uber.org/zap"
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/stv0g/cunicu/pkg/signaling"
)
@@ -250,11 +249,3 @@ func (d *Daemon) ForEachInterface(cb func(i *Interface) error) error {
return nil
}
func (d *Daemon) ConfigureDevice(name string, cfg wgtypes.Config) error {
if err := d.client.ConfigureDevice(name, cfg); err != nil {
return err
}
return d.watcher.Sync()
}