Skip to content

Commit ed00925

Browse files
committed
Disable raw_sendmsg and rawv6_sendmsg for now.
1 parent b24682b commit ed00925

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

counter.c

+8
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ static inline size_t process_udp_send(struct sk_buff *skb, statkey *key,
587587
return msglen;
588588
}
589589

590+
#if 0
590591
/**
591592
* Process raw ICMP socket information for IPv4 and populate the key structure.
592593
*
@@ -635,7 +636,9 @@ static inline void process_raw_sendmsg4(struct sock *sk, struct msghdr *msg,
635636
key->proto = IPPROTO_ICMP;
636637
key->pid = pid;
637638
}
639+
#endif
638640

641+
#if 0
639642
/**
640643
* Process raw ICMP socket information for IPv6 and populate the key structure.
641644
*
@@ -678,6 +681,7 @@ static inline void process_raw_sendmsg6(struct sock *sk, struct msghdr *msg,
678681
key->proto = IPPROTO_ICMPV6;
679682
key->pid = pid;
680683
}
684+
#endif
681685

682686
/**
683687
* Update the packet and byte counters for the given key in the packet count
@@ -961,6 +965,7 @@ int BPF_KPROBE(icmpv6_rcv, struct sk_buff *skb) {
961965
return 0;
962966
}
963967

968+
#if 0
964969
/**
965970
* Hook function for kprobe on raw_sendmsg function.
966971
*
@@ -991,7 +996,9 @@ int BPF_KPROBE(raw_sendmsg, struct sock *sk, struct msghdr *msg, size_t len) {
991996

992997
return 0;
993998
}
999+
#endif
9941000

1001+
#if 0
9951002
/**
9961003
* Hook function for kprobe on rawv6_sendmsg function.
9971004
*
@@ -1022,5 +1029,6 @@ int BPF_KPROBE(rawv6_sendmsg, struct sock *sk, struct msghdr *msg, size_t len) {
10221029

10231030
return 0;
10241031
}
1032+
#endif
10251033

10261034
char __license[] SEC("license") = "Dual MIT/GPL";

main.go

-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ func main() {
7979
{kprobe: "icmp6_send", prog: objs.Icmp6Send},
8080
{kprobe: "icmp_rcv", prog: objs.IcmpRcv},
8181
{kprobe: "icmpv6_rcv", prog: objs.Icmpv6Rcv},
82-
//{kprobe: "raw_sendmsg", prog: objs.RawSendmsg},
83-
//{kprobe: "rawv6_sendmsg", prog: objs.Rawv6Sendmsg},
8482
}
8583

8684
links = startKProbes(hooks, links)

0 commit comments

Comments
 (0)