Skip to content

Conversation

@stffabi
Copy link
Contributor

@stffabi stffabi commented Sep 8, 2023

This PR makes it possible to use classic BPF programs to be applied to a BPF Filter, without the need to load a eBPF program.

@stffabi stffabi force-pushed the feature/bpf-filter-ops branch from 479949c to 4f2580e Compare September 11, 2023 15:44
}

func deserializeSockFilter(opsLen uint16, ops []byte) ([]SockFilter, error) {
if excp := int(opsLen) * 8; len(ops) != excp {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to define this excp inside this if?
I do not think it gives us much compared to

if len(ops) != 8*opsLen {
           [...]", len(ops), 8*opsLen)
}

Jf: ops[3],
K: native.Uint32(ops[4:]),
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe remove this blank line

if filter.Fd >= 0 {
return fmt.Errorf("only Ops or Fd can be specified on a BpfFilter")
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls remove the blank line

@aboch
Copy link
Collaborator

aboch commented Jul 3, 2024

@stffabi please resolve the conflict and address a couple of minor comemnts

@aboch
Copy link
Collaborator

aboch commented May 9, 2025

@stffabi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants