AF_XDP-example: fix XDP prog attach for xdp-skb mode

The attach mode is by default set to XDP_MODE_NATIVE and needs to be
overwritten to XDP_MODE_SKB when '-S' option is used. Instead of
overwriting the attach mode was ORed and so was always running in NATIVE
mode. This patch fixes that.

Signed-off-by: Tirthendu Sarkar <tirthendu.sarkar@intel.com>
This commit is contained in:
Tirthendu Sarkar
2023-02-03 10:26:38 +01:00
committed by Toke Høiland-Jørgensen
parent 54a31ceabc
commit f27b9881bf

View File

@@ -1177,7 +1177,7 @@ static void parse_command_line(int argc, char **argv)
opt_poll = 1;
break;
case 'S':
opt_attach_mode |= XDP_MODE_SKB;
opt_attach_mode = XDP_MODE_SKB;
opt_xdp_bind_flags |= XDP_COPY;
break;
case 'N':