Skip to content

Commit

Permalink
ipv4-allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
perfecto25 committed Nov 30, 2022
1 parent cc85928 commit 751a733
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions udp/udp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

type Conn struct {
sysFd int
isV4 bool
isV4 bool
l *logrus.Logger
batch int
}
Expand Down Expand Up @@ -67,7 +67,6 @@ func isZeros(p net.IP) bool {
return true
}


func NewListener(l *logrus.Logger, ip string, port int, multi bool, batch int) (*Conn, error) {
lip := net.ParseIP(ip)
lipV4, isV4 := isIPV4(lip)
Expand All @@ -87,7 +86,6 @@ func NewListener(l *logrus.Logger, ip string, port int, multi bool, batch int) (
return nil, fmt.Errorf("unable to open socket: %s", err)
}


copy(lip[:], net.ParseIP(ip))

if multi {
Expand Down Expand Up @@ -186,7 +184,6 @@ func (u *Conn) ListenOut(r EncReader, lhf LightHouseHandlerFunc, cache *firewall
} else {
udpAddr.IP = names[i][8:24]
}
udpAddr.IP = names[i][8:24]
udpAddr.Port = binary.BigEndian.Uint16(names[i][2:4])
r(udpAddr, nil, plaintext[:0], buffers[i][:msgs[i].Len], h, fwPacket, lhf, nb, q, cache.Get(u.l))
}
Expand Down Expand Up @@ -349,4 +346,4 @@ func NewUDPStatsEmitter(udpConns []*Conn) func() {
}
}
}
}
}

0 comments on commit 751a733

Please sign in to comment.