mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2025-01-25 21:48:35 +01:00
remove duplicated dump
This commit is contained in:
parent
ec63f38ba2
commit
028a3533a1
@ -83,8 +83,12 @@ func (device *Device) SendPacket(peer *Peer, usage path.Usage, ttl uint8, packet
|
||||
}
|
||||
|
||||
func (device *Device) RoutineSendPacket() {
|
||||
var elem *QueueOutboundElement
|
||||
for {
|
||||
var elem *QueueOutboundElement
|
||||
if elem != nil {
|
||||
device.PutMessageBuffer(elem.buffer)
|
||||
device.PutOutboundElement(elem)
|
||||
}
|
||||
elem = device.NewOutboundElement()
|
||||
params := <-device.chan_send_packet
|
||||
offset := params.offset
|
||||
|
@ -19,8 +19,6 @@ import (
|
||||
"github.com/KusakabeSi/EtherGuard-VPN/mtypes"
|
||||
"github.com/KusakabeSi/EtherGuard-VPN/path"
|
||||
"github.com/KusakabeSi/EtherGuard-VPN/tap"
|
||||
"github.com/google/gopacket"
|
||||
"github.com/google/gopacket/layers"
|
||||
"golang.org/x/crypto/chacha20poly1305"
|
||||
)
|
||||
|
||||
@ -281,14 +279,6 @@ func (device *Device) RoutineReadFromTUN() {
|
||||
if peer == nil {
|
||||
continue
|
||||
}
|
||||
if device.LogLevel.LogNormal {
|
||||
packet_len := len(elem.packet) - path.EgHeaderLen
|
||||
fmt.Printf("Normal: Send Len:%v S:%v D:%v TTL:%v To:%v IP:%v:\n", packet_len, device.ID.ToString(), dst_nodeID.ToString(), elem.TTL, peer.ID.ToString(), peer.GetEndpointDstStr())
|
||||
if device.LogLevel.DumpNormal {
|
||||
packet_dump := gopacket.NewPacket(elem.packet[path.EgHeaderLen:], layers.LayerTypeEthernet, gopacket.Default)
|
||||
fmt.Println(packet_dump.Dump())
|
||||
}
|
||||
}
|
||||
device.SendPacket(peer, elem.Type, elem.TTL, elem.packet, offset)
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user