Skip to content

Commit

Permalink
pkg: adapt to new signature for tun
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Mar 23, 2023
1 parent b62e339 commit 7216b3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vpn/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ type device struct {
func (d *device) Up() {
go func() {
b := make([]byte, 4096)
bufs := [][]byte{b}
sizes := []int{4096}
for {
n, err := d.tun.Read(b, 0) // zero offset
n, err := d.tun.Read(bufs, sizes, 0) // zero offset
if err != nil {
logger.Errorf("tun read error: %v", err)
break
Expand All @@ -204,7 +206,8 @@ func (d *device) Up() {
logger.Errorf("vpn read error: %v", err)
break
}
_, err = d.tun.Write(b[0:n], 0) // zero offset

_, err = d.tun.Write([][]byte{b[0:n]}, 0) // zero offset
if err != nil {
logger.Errorf("tun write error: %v", err)
break
Expand Down

0 comments on commit 7216b3e

Please sign in to comment.