Simple lie test (#427)

This commit is contained in:
Nathan Brown 2021-03-31 10:26:35 -05:00 committed by GitHub
parent 830d6d4639
commit 0c2e5973e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 650 additions and 121 deletions

View file

@ -38,6 +38,7 @@ func NewListener(l *logrus.Logger, ip string, port int, _ bool) (*udpConn, error
// this is an encrypted packet or a handshake message in most cases
// packets were transmitted from another nebula node, you can send them with Tun.Send
func (u *udpConn) Send(packet *UdpPacket) {
u.l.Infof("UDP injecting packet %+v", packet)
u.rxPackets <- packet
}
@ -71,8 +72,8 @@ func (u *udpConn) WriteTo(b []byte, addr *udpAddr) error {
}
copy(p.Data, b)
copy(p.ToIp, addr.IP)
copy(p.FromIp, u.addr.IP)
copy(p.ToIp, addr.IP.To16())
copy(p.FromIp, u.addr.IP.To16())
u.txPackets <- p
return nil