Skip to content

Force AttachXDP to overwrite an already attached program #1611

Answered by florianl
FHRNet asked this question in Q&A
Discussion options

You must be logged in to vote

With (*RawLink) Update(..) you should be able to update the eBPF program for an existing link.

// Attach eBPF program to XDP hook.
lnk, err := AttachXDP(XDPOptions{...})

[..]

// Some time later, replace the eBPF program with a new one
err := lnk.Update(&ebpf.Program{..})

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@FHRNet
Comment options

@ti-mo
Comment options

Answer selected by FHRNet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants