]> Pileus Git - ~andy/linux/blobdiff - net/ipv4/fib_frontend.c
net: Push capable(CAP_NET_ADMIN) into the rtnl methods
[~andy/linux] / net / ipv4 / fib_frontend.c
index 825c608826de1c4b5dea08c46e6ff4255117c990..bce4541c67844be50387c5a3f731f8392051d634 100644 (file)
@@ -613,6 +613,9 @@ static int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *ar
        struct fib_table *tb;
        int err;
 
+       if (!capable(CAP_NET_ADMIN))
+               return -EPERM;
+
        err = rtm_to_fib_config(net, skb, nlh, &cfg);
        if (err < 0)
                goto errout;
@@ -635,6 +638,9 @@ static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *ar
        struct fib_table *tb;
        int err;
 
+       if (!capable(CAP_NET_ADMIN))
+               return -EPERM;
+
        err = rtm_to_fib_config(net, skb, nlh, &cfg);
        if (err < 0)
                goto errout;