Skip to content

Commit 0932b59

Browse files
committed
Do not send nil packets for unhandled L4 protocols
1 parent 30b8968 commit 0932b59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sockets/raw_socket.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ func handleLayer4Protocol(protocol string, packet protocols.IPPacket, dataChan c
143143
np, err = protocols.UDPPacketFromIPPacket(packet)
144144
case "tcp":
145145
np, err = protocols.TCPPacketFromIPPacket(packet)
146+
default:
147+
// TODO: maybe support more protocols
148+
return
146149
}
147150

148151
if err != nil {

0 commit comments

Comments
 (0)