Skip to content

Commit

Permalink
udpconnect: show UDP only, exclude ICMP and RAW
Browse files Browse the repository at this point in the history
  • Loading branch information
brendangregg committed Apr 20, 2020
1 parent 21724cc commit 09f8a3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion updated/Ch10_Networking/udpconnect.bt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ BEGIN
kprobe:ip4_datagram_connect,
kprobe:ip6_datagram_connect
{
$sk = (struct sock *)arg0;
$sa = (struct sockaddr *)arg1;
if ($sa->sa_family == AF_INET || $sa->sa_family == AF_INET6) {
if (($sa->sa_family == AF_INET || $sa->sa_family == AF_INET6) &&
$sk->sk_protocol == IPPROTO_UDP) {
time("%H:%M:%S ");
if ($sa->sa_family == AF_INET) {
$s = (struct sockaddr_in *)arg1;
Expand Down

0 comments on commit 09f8a3a

Please sign in to comment.