aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/farp
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2013-06-25 08:37:01 +0200
committerTobias Brunner <tobias@strongswan.org>2013-06-25 17:16:32 +0200
commit405f5ab9e92d0cfe78fe33de081e02cfd89b91d1 (patch)
tree940d2d9cd57ffabb5fc3d3ddcbab587893b4d401 /src/libcharon/plugins/farp
parent6f15f5e632917775db9ecf2826532884f34877e8 (diff)
downloadstrongswan-405f5ab9e92d0cfe78fe33de081e02cfd89b91d1.tar.bz2
strongswan-405f5ab9e92d0cfe78fe33de081e02cfd89b91d1.tar.xz
farp: Require CAP_NET_RAW capability to open AF_PACKET socket
Diffstat (limited to 'src/libcharon/plugins/farp')
-rw-r--r--src/libcharon/plugins/farp/farp_plugin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcharon/plugins/farp/farp_plugin.c b/src/libcharon/plugins/farp/farp_plugin.c
index cbc0bcf82..d31defca4 100644
--- a/src/libcharon/plugins/farp/farp_plugin.c
+++ b/src/libcharon/plugins/farp/farp_plugin.c
@@ -92,6 +92,12 @@ plugin_t *farp_plugin_create()
{
private_farp_plugin_t *this;
+ if (!lib->caps->keep(lib->caps, CAP_NET_RAW))
+ { /* required to open ARP socket (AF_PACKET) */
+ DBG1(DBG_NET, "farp plugin requires CAP_NET_RAW capability");
+ return NULL;
+ }
+
INIT(this,
.public = {
.plugin = {