shw_dev
shw 8 years ago
parent 8fe02202de
commit 942b0a0c01

@ -259,12 +259,13 @@ func printPacket(pkt *nfqueue.NFQPacket, hostname string, pinfo *procsnitch.Info
SrcPort, DstPort := uint16(0), uint16(0) SrcPort, DstPort := uint16(0), uint16(0)
SrcIp, DstIp := getPacketIP4Addrs(pkt) SrcIp, DstIp := getPacketIP4Addrs(pkt)
switch pkt.Packet.TransportLayer().TransportFlow().EndpointType() { // switch pkt.Packet.TransportLayer().TransportFlow().EndpointType() {
case 4: if pkt.Packet.Layer(layers.LayerTypeTCP) != nil {
proto = "TCP" // case 4:
case 5: proto = "TCP"
proto = "UDP" } else if pkt.Packet.Layer(layers.LayerTypeUDP) != nil {
default: // case 5:
proto = "UDP"
} }
if proto == "TCP" { if proto == "TCP" {

Loading…
Cancel
Save