renamed uapiConn and lint errors

This commit is contained in:
mlsmaycon 2021-06-07 00:35:17 +02:00
parent 698ebe2287
commit caf2229d3b
2 changed files with 9 additions and 3 deletions

View File

@ -29,7 +29,10 @@ func Create(iface string, address string) error {
// We need to create a wireguard-go device and listen to configuration requests
tunDevice := device.NewDevice(tunIface, conn.NewDefaultBind(), device.NewLogger(device.LogLevelSilent, "[wiretrustee] "))
tunDevice.Up()
err = tunDevice.Up()
if err != nil {
return err
}
uapi, err := getUAPI(iface)
if err != nil {
return err
@ -37,12 +40,12 @@ func Create(iface string, address string) error {
go func() {
for {
conn, err := uapi.Accept()
uapiConn, err := uapi.Accept()
if err != nil {
log.Debugln(err)
return
}
go tunDevice.IpcHandle(conn)
go tunDevice.IpcHandle(uapiConn)
}
}()

View File

@ -17,6 +17,9 @@ func assignAddr(address string, tunDevice tun.Device) error {
var err error
attrs := netlink.NewLinkAttrs()
attrs.Name, err = tunDevice.Name()
if err != nil {
return err
}
link := wgLink{
attrs: &attrs,