Skip to content

Commit 12a7c06

Browse files
committed
Disable raw_sendmsg and rawv6_sendmsg for now.
1 parent d8dfed2 commit 12a7c06

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
@@ -661,6 +661,7 @@ static inline size_t process_udp_send(struct sk_buff *skb, statkey *key,
661661
return msglen;
662662
}
663663

664+
#if 0
664665
/**
665666
* Process raw ICMP socket information for IPv4 and populate the key structure.
666667
*
@@ -709,7 +710,9 @@ static inline void process_raw_sendmsg4(struct sock *sk, struct msghdr *msg,
709710
key->proto = IPPROTO_ICMP;
710711
key->pid = pid;
711712
}
713+
#endif
712714

715+
#if 0
713716
/**
714717
* Process raw ICMP socket information for IPv6 and populate the key structure.
715718
*
@@ -752,6 +755,7 @@ static inline void process_raw_sendmsg6(struct sock *sk, struct msghdr *msg,
752755
key->proto = IPPROTO_ICMPV6;
753756
key->pid = pid;
754757
}
758+
#endif
755759

756760
/**
757761
* Update the packet and byte counters for the given key in the packet count
@@ -1035,6 +1039,7 @@ int BPF_KPROBE(icmpv6_rcv, struct sk_buff *skb) {
10351039
return 0;
10361040
}
10371041

1042+
#if 0
10381043
/**
10391044
* Hook function for kprobe on raw_sendmsg function.
10401045
*
@@ -1065,7 +1070,9 @@ int BPF_KPROBE(raw_sendmsg, struct sock *sk, struct msghdr *msg, size_t len) {
10651070

10661071
return 0;
10671072
}
1073+
#endif
10681074

1075+
#if 0
10691076
/**
10701077
* Hook function for kprobe on rawv6_sendmsg function.
10711078
*
@@ -1096,5 +1103,6 @@ int BPF_KPROBE(rawv6_sendmsg, struct sock *sk, struct msghdr *msg, size_t len) {
10961103

10971104
return 0;
10981105
}
1106+
#endif
10991107

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

main.go

-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ func main() {
8181
{kprobe: "icmp6_send", prog: objs.Icmp6Send},
8282
{kprobe: "icmp_rcv", prog: objs.IcmpRcv},
8383
{kprobe: "icmpv6_rcv", prog: objs.Icmpv6Rcv},
84-
//{kprobe: "raw_sendmsg", prog: objs.RawSendmsg},
85-
//{kprobe: "rawv6_sendmsg", prog: objs.Rawv6Sendmsg},
8684
}
8785

8886
links = startKProbes(hooks, links)

0 commit comments

Comments
 (0)