* kernel, by Linus Torvalds and others.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <asm/uaccess.h>
#include <linux/completion.h>
struct sk_buff *request;
char name[IFNAMSIZ];
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
if (copy_from_user(name, uname, IFNAMSIZ))
return -EFAULT;
struct net_device *port;
int err;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
port = __dev_get_by_index(&init_net, port_ifindex);
if (!port)
return -EINVAL;
/* Wait for reply. */
error = -ETIMEDOUT;
if (!wait_for_completion_timeout(&brc_done, BRC_TIMEOUT)) {
- printk(KERN_WARNING "brcompat: timed out waiting for userspace\n");
+ pr_warn("timed out waiting for userspace\n");
goto error;
}
err_unregister:
genl_unregister_family(&brc_genl_family);
error:
- printk(KERN_EMERG "brcompat: failed to install!");
+ pr_emerg("failed to install!\n");
return err;
}