mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-22 00:06:04 +08:00
ext test
This commit is contained in:
parent
1beee3ff02
commit
46d63d19a3
|
@ -160,9 +160,13 @@ func StartSniffer(ctx context.Context, ifaceName, ingGwAddr, extClientAddr strin
|
||||||
(ip.DstIP.String() == extClientAddr && ip.SrcIP.String() != ingGwAddr) {
|
(ip.DstIP.String() == extClientAddr && ip.SrcIP.String() != ingGwAddr) {
|
||||||
|
|
||||||
log.Println("-----> Fowarding PKT From: ", ip.SrcIP, " to: ", ip.DstIP)
|
log.Println("-----> Fowarding PKT From: ", ip.SrcIP, " to: ", ip.DstIP)
|
||||||
err := handle.WritePacketData(packet.Data())
|
c, err := net.Dial("ip", ip.DstIP.String())
|
||||||
if err != nil {
|
if err == nil {
|
||||||
log.Println("----> failed to send packet data: ", err)
|
c.Write(ip.Payload)
|
||||||
|
c.Close()
|
||||||
|
} else {
|
||||||
|
log.Println("------> Failed to forward packet from sniffer: ", err)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue