diff --git a/kf/kf_unix.go b/kf/kf_unix.go index ccda798f..7c75bb20 100644 --- a/kf/kf_unix.go +++ b/kf/kf_unix.go @@ -309,6 +309,16 @@ func (b *BPF) LoadTCAttachProgram(ifaceName, direction string, eBPFProgram *BPF) return fmt.Errorf("could not attach filter to interface %s for eBPF program %s : %v", ifaceName, eBPFProgram.Program.Name, err) } + progInfo, err := bpfRootProg.Info() + if err != nil { + return fmt.Errorf("could not get program info of %s to interface %s : %v", b.Program.Name, ifaceName, err) + } + + ok := false + b.ProgID, ok = progInfo.ID() + if !ok { + return fmt.Errorf("failed to fetch the tc program %s to interface %s : %v", b.Program.Name, ifaceName, err) + } return nil }