]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
pf: reject client if PF plugin is configured, but init fails
authorSteffan Karger <steffan@karger.me>
Wed, 1 Nov 2017 22:03:40 +0000 (23:03 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 24 Nov 2017 12:23:26 +0000 (13:23 +0100)
This changes the behavior for pf plugins: instead of just not initializing
the firewall rules and happily continuing, this now rejects the client in
the case of an (unlikely) failure to initialize the pf.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20171101220342.14648-3-steffan@karger.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15704.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/pf.c

index e1b5b0e7d4bfabf0ed0af830498f107b9373e270..6e4107c508b3e2a2f6fd64bc2d11dbb42116022f 100644 (file)
@@ -638,10 +638,12 @@ pf_init_context(struct context *c)
                 }
 #endif
             }
-            else
-            {
-                msg(M_WARN, "WARNING: OPENVPN_PLUGIN_ENABLE_PF disabled");
-            }
+        }
+        if (!c->c2.pf.enabled)
+        {
+            msg(M_WARN, "WARNING: failed to init PF plugin, rejecting client.");
+            register_signal(c, SIGUSR1, "plugin-pf-init-failed");
+            return;
         }
     }
 #endif /* ifdef PLUGIN_PF */