Skip to content

Commit

Permalink
renamed uapiConn and lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsmaycon committed Jun 6, 2021
1 parent 698ebe2 commit caf2229
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions iface/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,23 @@ 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
}

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)
}
}()

Expand Down
3 changes: 3 additions & 0 deletions iface/iface_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit caf2229

Please sign in to comment.