]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/ip.c
iproute2: add check_libbpf() and get_libbpf_version()
[mirror_iproute2.git] / ip / ip.c
diff --git a/ip/ip.c b/ip/ip.c
index 5e31957f2420abacc279e0da0a08a32577620ffe..466dbb5263d644aa735541e736d07b6c93ad89a7 100644 (file)
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -24,6 +24,7 @@
 #include "namespace.h"
 #include "color.h"
 #include "rt_names.h"
+#include "bpf_util.h"
 
 int preferred_family = AF_UNSPEC;
 int human_readable;
@@ -147,8 +148,9 @@ static int batch(const char *name)
 
 int main(int argc, char **argv)
 {
-       char *basename;
+       const char *libbpf_version;
        char *batch_file = NULL;
+       char *basename;
        int color = 0;
 
        /* to run vrf exec without root, capabilities might be set, drop them
@@ -229,7 +231,11 @@ int main(int argc, char **argv)
                        ++timestamp;
                        ++timestamp_short;
                } else if (matches(opt, "-Version") == 0) {
-                       printf("ip utility, iproute2-%s\n", version);
+                       printf("ip utility, iproute2-%s", version);
+                       libbpf_version = get_libbpf_version();
+                       if (libbpf_version)
+                               printf(", libbpf %s", libbpf_version);
+                       printf("\n");
                        exit(0);
                } else if (matches(opt, "-force") == 0) {
                        ++force;