Skip to content

Commit c220347

Browse files
committed
Evade needing to compile own libxdp for skipping the dispatcher by setting env var
1 parent 9d9d590 commit c220347

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

xdp-server.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,11 @@ static int load_xdp_program_and_map(struct xdp_server *xdp) {
230230
}
231231

232232
if (xdp->bpf_prog_should_load) {
233-
/* err = xdp_program__attach(xdp->bpf_prog, xdp->interface_index, attach_mode, 0); */
234-
err = xdp_program__attach_single(xdp->bpf_prog, xdp->interface_index, attach_mode);
233+
/* TODO: I find setting environment variables from within a program
234+
* not a good thing to do, but for the meantime this helps... */
235+
putenv("LIBXDP_SKIP_DISPATCHER=1");
236+
err = xdp_program__attach(xdp->bpf_prog, xdp->interface_index, attach_mode, 0);
237+
/* err = xdp_program__attach_single(xdp->bpf_prog, xdp->interface_index, attach_mode); */
235238
if (err) {
236239
libxdp_strerror(err, errmsg, sizeof(errmsg));
237240
log_msg(LOG_ERR, "xdp: could not attach xdp program to interface '%s' : %s\n",

0 commit comments

Comments
 (0)