mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-15 15:20:44 -08:00
Simple lie test (#427)
This commit is contained in:
parent
830d6d4639
commit
0c2e5973e1
16 changed files with 650 additions and 121 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue