Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
[sfrench/cifs-2.6.git] / samples / bpf / xdp_tx_iptunnel_user.c
index 2fe4c7f5ffe5e80b0e548f3051412683811af6ea..a419bee151a85c60ded0a55943a2a6da43f38080 100644 (file)
@@ -15,7 +15,7 @@
 #include <netinet/ether.h>
 #include <unistd.h>
 #include <time.h>
-#include "libbpf.h"
+#include <bpf/libbpf.h>
 #include <bpf/bpf.h>
 #include "bpf_util.h"
 #include "xdp_tx_iptunnel_common.h"
@@ -231,7 +231,7 @@ int main(int argc, char **argv)
                        xdp_flags |= XDP_FLAGS_SKB_MODE;
                        break;
                case 'N':
-                       xdp_flags |= XDP_FLAGS_DRV_MODE;
+                       /* default, set below */
                        break;
                case 'F':
                        xdp_flags &= ~XDP_FLAGS_UPDATE_IF_NOEXIST;
@@ -243,6 +243,9 @@ int main(int argc, char **argv)
                opt_flags[opt] = 0;
        }
 
+       if (!(xdp_flags & XDP_FLAGS_SKB_MODE))
+               xdp_flags |= XDP_FLAGS_DRV_MODE;
+
        for (i = 0; i < strlen(optstr); i++) {
                if (opt_flags[(unsigned int)optstr[i]]) {
                        fprintf(stderr, "Missing argument -%c\n", optstr[i]);