]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip vrf: Move kernel config hint to prog_load failure
authorDavid Ahern <dsa@cumulusnetworks.com>
Thu, 15 Dec 2016 20:06:59 +0000 (12:06 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 21 Dec 2016 23:56:39 +0000 (15:56 -0800)
Move the hint about CGROUP_BPF enabled to prog_load failure since
it fails before the attach. Update the existing error message to
print to stderr.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
ip/ipvrf.c

index 4d59845416cdc341693f65c7a6001b4ba2ef9f10..44ad7e07024acea0a3041d9b623086cee8e5acb8 100644 (file)
@@ -170,14 +170,15 @@ static int vrf_configure_cgroup(const char *path, int ifindex)
         */
        prog_fd = prog_load(ifindex);
        if (prog_fd < 0) {
-               printf("Failed to load BPF prog: '%s'\n", strerror(errno));
+               fprintf(stderr, "Failed to load BPF prog: '%s'\n",
+                       strerror(errno));
+               fprintf(stderr, "Kernel compiled with CGROUP_BPF enabled?\n");
                goto out;
        }
 
        if (bpf_prog_attach_fd(prog_fd, cg_fd, BPF_CGROUP_INET_SOCK_CREATE)) {
                fprintf(stderr, "Failed to attach prog to cgroup: '%s'\n",
                        strerror(errno));
-               fprintf(stderr, "Kernel compiled with CGROUP_BPF enabled?\n");
                goto out;
        }