Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip ebpf program #1

Merged
merged 1 commit into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bpf/mb_bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ limitations under the License.
// 0.0.0.0:4140
__section("cgroup/bind4") int mb_bind(struct bpf_sock_addr *ctx)
{
debugf("cgroup/bind4 entry");
return 1;
#if MESH != LINKERD
// only works on linkerd
return 1;
Expand Down
3 changes: 3 additions & 0 deletions bpf/mb_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ static inline int tcp4_connect(struct bpf_sock_addr *ctx)

__section("cgroup/connect4") int mb_sock4_connect(struct bpf_sock_addr *ctx)
{
debugf("cgroup/connect4 entry");
return 1;

switch (ctx->protocol) {
case IPPROTO_TCP:
return tcp4_connect(ctx);
Expand Down
3 changes: 3 additions & 0 deletions bpf/mb_get_sockopts.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ limitations under the License.

__section("cgroup/getsockopt") int mb_get_sockopt(struct bpf_sockopt *ctx)
{
debugf("cgroup/getsockopt entry");
return 1;

// currently, eBPF can not deal with optlen more than 4096 bytes, so, we
// should limit this.
if (ctx->optlen > MAX_OPS_BUFF_LENGTH) {
Expand Down
3 changes: 3 additions & 0 deletions bpf/mb_recvmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ limitations under the License.

__section("cgroup/recvmsg4") int mb_recvmsg4(struct bpf_sock_addr *ctx)
{
debugf("cgroup/recvmsg4 entry");
return 1;

#if MESH != ISTIO
// only works on istio
return 1;
Expand Down
3 changes: 3 additions & 0 deletions bpf/mb_redir.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ limitations under the License.

__section("sk_msg") int mb_msg_redir(struct sk_msg_md *msg)
{
debugf("sk_msg entry");
return 1;

struct pair p = {
.dip = msg->local_ip4,
.dport = bpf_htons(msg->local_port),
Expand Down
3 changes: 3 additions & 0 deletions bpf/mb_sendmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ limitations under the License.

__section("cgroup/sendmsg4") int mb_sendmsg4(struct bpf_sock_addr *ctx)
{
debugf("cgroup/sendmsg4 entry");
return 1;

#if MESH != ISTIO
// only works on istio
return 1;
Expand Down
3 changes: 3 additions & 0 deletions bpf/mb_sockops.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ static inline int sockops_ipv4(struct bpf_sock_ops *skops)

__section("sockops") int mb_sockops(struct bpf_sock_ops *skops)
{
debugf("sockops entry");
return 1;

__u32 family, op;
family = skops->family;
op = skops->op;
Expand Down
3 changes: 3 additions & 0 deletions bpf/mb_xdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ static __always_inline __u16 csum_diff4(__u32 from, __u32 to, __u16 csum)

__section("xdp") int mb_xdp(struct xdp_md *ctx)
{
debugf("xdp entry");
return XDP_PASS;

void *data = (void *)(long)ctx->data;
void *data_end = (void *)(long)ctx->data_end;
struct ethhdr *eth = (struct ethhdr *)data;
Expand Down