source: src/router/services/services/openvpn.c @ 19211

Last change on this file since 19211 was 19211, checked in by sash, 13 months ago

ovpn: finish dhcp block

File size: 16.8 KB
Line 
1/*
2 * openvpn.c
3 *
4 * Copyright (C) 2005 - 2006 Sebastian Gottschall <gottschall@dd-wrt.com
5 * Copyright (C) 2010 - 2012 Sash
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 *
21 * $Id:
22 */
23
24#include <ctype.h>
25#include <string.h>
26#include <stdio.h>
27#include <stdlib.h>
28#include <signal.h>
29#include <bcmnvram.h>
30#include <bcmutils.h>
31#include <shutils.h>
32#include <syslog.h>
33#include <services.h>
34#include <utils.h>
35
36#ifdef HAVE_OPENVPN
37
38void start_openvpnserver(void)
39{
40
41        if (nvram_invmatch("openvpn_enable", "1"))
42                return;
43        dd_syslog(LOG_INFO, "openvpn : OpenVPN daemon (Server) starting/restarting...\n");
44        mkdir("/tmp/openvpn", 0700);
45        mkdir("/tmp/openvpn/ccd", 0700);
46        write_nvram("/tmp/openvpn/ccd/DEFAULT", "openvpn_ccddef");
47        write_nvram("/tmp/openvpn/dh.pem", "openvpn_dh");
48        write_nvram("/tmp/openvpn/ca.crt", "openvpn_ca");
49        write_nvram("/tmp/openvpn/cert.pem", "openvpn_crt");
50        write_nvram("/tmp/openvpn/ca.crl", "openvpn_crl");
51        write_nvram("/tmp/openvpn/key.pem", "openvpn_key");
52        write_nvram("/tmp/openvpn/ta.key", "openvpn_tlsauth");
53
54        FILE *fp = fopen("/tmp/openvpn/openvpn.conf", "wb");
55        if (fp == NULL)
56                return;
57        if (nvram_invmatch("openvpn_dh", ""))
58                fprintf(fp, "dh /tmp/openvpn/dh.pem\n");
59        if (nvram_invmatch("openvpn_ca", ""))
60                fprintf(fp, "ca /tmp/openvpn/ca.crt\n");
61        if (nvram_invmatch("openvpn_crt", ""))
62                fprintf(fp, "cert /tmp/openvpn/cert.pem\n");
63        if (nvram_invmatch("openvpn_key", ""))
64                fprintf(fp, "key /tmp/openvpn/key.pem\n");
65        //be sure Chris old style config is still working
66        if (nvram_match("openvpn_switch", "1")) {
67                write_nvram("/tmp/openvpn/cert.pem", "openvpn_crt");
68                fprintf(fp, "keepalive 10 120\n"
69                        "verb 4\n" "mute 5\n"
70                        "log-append /var/log/openvpn\n"
71                        "writepid /var/log/openvpnd.pid\n"
72                        "management 127.0.0.1 5002\n"
73                        "management-log-cache 50\n"
74                        "mtu-disc yes\n"
75                        "topology subnet\n"
76                        "client-config-dir /tmp/openvpn/ccd\n"
77                        "script-security 2\n"
78                        "port %s\n"
79                        "proto %s\n"
80                        "cipher %s\n"
81                        "auth %s\n", nvram_safe_get("openvpn_port"),
82                        nvram_safe_get("openvpn_proto"),
83                        nvram_safe_get("openvpn_cipher"),
84                        nvram_safe_get("openvpn_auth"));
85                if (nvram_invmatch("openvpn_auth", "none")) //not needed if we have no auth anyway
86                        fprintf(fp, "tls-server\n");
87                if (nvram_match("openvpn_dupcn", "1"))
88                        fprintf(fp, "duplicate-cn\n");
89                //keep peer ip persistant for x sec. works only when dupcn=off & no proxy mode
90                if (nvram_match("openvpn_dupcn", "0")
91                    && nvram_match("openvpn_proxy", "0"))
92                        fprintf(fp,
93                                "ifconfig-pool-persist /tmp/openvpn/ip-pool 86400\n");
94//              if (nvram_match("openvpn_certtype", "1"))       //server doenst need this
95//                      fprintf(fp, "ns-cert-type server\n");
96                if (nvram_invmatch("openvpn_lzo", "0"))
97                        fprintf(fp, "comp-lzo %s\n",    //yes/no/adaptive/disable
98                                nvram_safe_get("openvpn_lzo"));
99                if (nvram_match("openvpn_cl2cl", "1"))
100                        fprintf(fp, "client-to-client\n");
101                if (nvram_match("openvpn_redirgate", "1"))
102                        fprintf(fp, "push \"redirect-gateway def1\"\n");
103                if (nvram_invmatch("openvpn_tlscip", "0"))
104                        fprintf(fp, "tls-cipher %s\n",
105                                nvram_safe_get("openvpn_tlscip"));
106                if (nvram_match("openvpn_proto", "udp"))
107                        fprintf(fp, "fast-io\n");       //experimental!improving CPU efficiency by 5%-10%
108                else            //TCP_NODELAY is generally a good latency optimization
109                        fprintf(fp, "tcp-nodelay\n");
110                if (nvram_invmatch("openvpn_mtu", ""))
111                        fprintf(fp, "tun-mtu %s\n",
112                                nvram_safe_get("openvpn_mtu"));
113                if (nvram_invmatch("openvpn_mssfix", "")
114                    && nvram_match("openvpn_proto", "udp")) {
115                        fprintf(fp, "mssfix\n");        //fragment==mssfix
116                        fprintf(fp, "fragment %s\n",
117                                nvram_safe_get("openvpn_mssfix"));
118                }
119                if (nvram_match("openvpn_tuntap", "tun")) {
120                        fprintf(fp, "server %s %s\n",
121                                nvram_safe_get("openvpn_net"),
122                                nvram_safe_get("openvpn_mask"));
123                        fprintf(fp, "dev tun2\n");
124//                      fprintf(fp, "tun-ipv6\n"); //enable ipv6 support. not supported on server in version 2.1.3
125                } else if (nvram_match("openvpn_tuntap", "tap") &&
126                           nvram_match("openvpn_proxy", "0")) {
127                        fprintf(fp, "server-bridge %s %s %s %s\n",
128                                nvram_safe_get("openvpn_gateway"),
129                                nvram_safe_get("openvpn_mask"),
130                                nvram_safe_get("openvpn_startip"),
131                                nvram_safe_get("openvpn_endip"));
132                        fprintf(fp, "dev tap2\n");
133                } else if (nvram_match("openvpn_tuntap", "tap") &&
134                           nvram_match("openvpn_proxy", "1") &&
135                           nvram_match("openvpn_redirgate", "1"))
136                        fprintf(fp, "server-bridge\n" "dev tap2\n");
137                else
138                        fprintf(fp, "server-bridge nogw\n" "dev tap2\n");
139                if (strlen(nvram_safe_get("openvpn_tlsauth")) > 0)
140                        fprintf(fp, "tls-auth /tmp/openvpn/ta.key 0\n");
141                if (strlen(nvram_safe_get("openvpn_crl")) > 0)
142                        fprintf(fp, "crl-verify /tmp/openvpn/ca.crl\n");
143                /* for QOS */
144                if (nvram_invmatch("wshaper_enable", "0"))
145                                fprintf(fp, "passtos\n");
146        } else
147                write_nvram("/tmp/openvpn/cert.pem", "openvpn_client");
148
149        fprintf(fp, "%s\n", nvram_safe_get("openvpn_config"));
150        fclose(fp);
151
152        fp = fopen("/tmp/openvpn/route-up.sh", "wb");
153        if (fp == NULL)
154                return;
155        fprintf(fp, "#!/bin/sh\n");
156#if defined(HAVE_TMK) || defined(HAVE_BKM)
157        char *gpiovpn = nvram_get("gpiovpn");
158        if (gpiovpn != NULL) {
159                fprintf(fp, "gpio enable %s\n", gpiovpn);
160        }
161#endif
162        //bring up tap interface when choosen
163        if (nvram_match("openvpn_tuntap", "tap")) {
164                fprintf(fp, "brctl addif br0 tap2\n"
165                        "ifconfig tap2 0.0.0.0 promisc up\n"
166                        "stopservice wshaper\n"
167                        "startservice wshaper\n");
168        }
169        if (nvram_match("block_multicast", "0") //block multicast on bridged vpns
170                && nvram_match("openvpn_tuntap", "tap"))
171                fprintf(fp, "insmod ebtables\n"
172                        "insmod ebtable_filter\n"
173                        "insmod ebt_pkttype\n"
174                        "ebtables -D FORWARD -o tap2 --pkttype-type multicast -j DROP\n"
175                        "ebtables -D OUTPUT -o tap2 --pkttype-type multicast -j DROP\n"
176                        "ebtables -A FORWARD -o tap2 --pkttype-type multicast -j DROP\n"
177                        "ebtables -A OUTPUT -o tap2 --pkttype-type multicast -j DROP\n");
178                //for testing only
179        if (nvram_match("openvpn_dhcpbl", "1") //block dhcp on bridged vpns
180                && nvram_match("openvpn_tuntap", "tap")
181                && nvram_match("openvpn_proxy", "0"))
182                fprintf(fp, "insmod ebtables\n"
183                        "insmod ebtable_filter\n" "insmod ebt_ip\n"
184                        "ebtables -D INPUT -i tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n"
185                        "ebtables -D FORWARD -i tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n"
186                        "ebtables -D FORWARD -o tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n"
187                        "ebtables -I INPUT -i tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n"
188                        "ebtables -I FORWARD -i tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n"
189                        "ebtables -I FORWARD -o tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n");
190        fprintf(fp, "startservice set_routes\n");
191        fclose(fp);
192
193        fp = fopen("/tmp/openvpn/route-down.sh", "wb");
194        if (fp == NULL)
195                return;
196        fprintf(fp, "#!/bin/sh\n");
197#if defined(HAVE_TMK) || defined(HAVE_BKM)
198        if (gpiovpn != NULL)
199                fprintf(fp, "gpio disable %s\n", gpiovpn);
200#endif
201        if (nvram_match("openvpn_tuntap", "tap"))
202                fprintf(fp, "brctl delif br0 tap2\n" "ifconfig tap2 down\n");
203        fclose(fp);
204
205        chmod("/tmp/openvpn/route-up.sh", 0700);
206        chmod("/tmp/openvpn/route-down.sh", 0700);
207        eval("ln", "-s", "/usr/sbin/openvpn", "/tmp/openvpnserver");
208
209        if (nvram_match("use_crypto", "1"))
210                eval("/tmp/openvpnserver", "--config",
211                     "/tmp/openvpn/openvpn.conf", "--route-up",
212                     "/tmp/openvpn/route-up.sh", "--down-pre",
213                     "/tmp/openvpn/route-down.sh", "--daemon", "--engine",
214                     "cryptodev");
215        else
216                eval("/tmp/openvpnserver", "--config",
217                     "/tmp/openvpn/openvpn.conf", "--route-up",
218                     "/tmp/openvpn/route-up.sh", "--down-pre",
219                     "/tmp/openvpn/route-down.sh", "--daemon");
220       
221        eval("stopservice", "wshaper");
222        eval("startservice", "wshaper");
223}
224
225void stop_openvpnserver(void)
226{
227#if defined(HAVE_TMK) || defined(HAVE_BKM)
228        char *gpiovpn = nvram_get("gpiovpn");
229        if (gpiovpn != NULL) {
230                set_gpio(atoi(gpiovpn), 0);
231        }
232#endif
233        if (stop_process("openvpnserver", "OpenVPN daemon (Server)")) {
234                eval("stopservice", "wshaper");
235                eval("startservice", "wshaper");
236                //remove btables rules on shutdown     
237                sytem("ebtables -D FORWARD -o tap2 --pkttype-type multicast -j DROP\n");
238                sytem("ebtables -D OUTPUT -o tap2 --pkttype-type multicast -j DROP\n");
239                sytem("ebtables -D INPUT -i tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n");
240                sytem("ebtables -D FORWARD -i tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n");
241                sytem("ebtables -D FORWARD -o tap2 --protocol IPv4 --ip-proto udp --ip-sport 67:68 -j DROP\n");
242        }
243
244        return;
245}
246
247void start_openvpnserverwan(void)
248{
249        if (nvram_match("openvpn_onwan", "1"))
250                start_openvpnserver();
251        return;
252}
253
254void stop_openvpnserverwan(void)
255{
256        if (nvram_match("openvpn_onwan", "1"))
257                stop_openvpnserver();
258        return;
259}
260
261void start_openvpnserversys(void)
262{
263        if (nvram_match("openvpn_onwan", "0"))
264                start_openvpnserver();
265        return;
266}
267
268void stop_openvpnserversys(void)
269{
270        if (nvram_match("openvpn_onwan", "0"))
271                stop_openvpnserver();
272        return;
273}
274
275void start_openvpn(void)
276{
277        if (nvram_invmatch("openvpncl_enable", "1"))
278                return;
279        dd_syslog(LOG_INFO, "openvpn : OpenVPN daemon (Client) starting/restarting...\n");
280        mkdir("/tmp/openvpncl", 0700);
281        write_nvram("/tmp/openvpncl/ca.crt", "openvpncl_ca");
282        write_nvram("/tmp/openvpncl/client.crt", "openvpncl_client");
283        write_nvram("/tmp/openvpncl/client.key", "openvpncl_key");
284        write_nvram("/tmp/openvpncl/ta.key", "openvpncl_tlsauth");
285        chmod("/tmp/openvpn/client.key", 0600);
286
287        FILE *fp = fopen("/tmp/openvpncl/openvpn.conf", "wb");
288        if (fp == NULL)
289                return;
290        if (nvram_invmatch("openvpncl_ca", ""))
291                fprintf(fp, "ca /tmp/openvpncl/ca.crt\n");
292        if (nvram_invmatch("openvpncl_client", ""))
293                fprintf(fp, "cert /tmp/openvpncl/client.crt\n");
294        if (nvram_invmatch("openvpncl_key", ""))
295                fprintf(fp, "key /tmp/openvpncl/client.key\n");
296        fprintf(fp,
297                "management 127.0.0.1 5001\n"
298                "management-log-cache 50\n"
299                "verb 4\n" "mute 5\n"
300                "log-append /var/log/openvpncl\n"
301                "writepid /var/log/openvpncl.pid\n"
302                "client\n"
303                "resolv-retry infinite\n"
304                "nobind\n" "persist-key\n" "persist-tun\n"
305                "script-security 2\n" "mtu-disc yes\n");
306        fprintf(fp, "dev %s1\n", nvram_safe_get("openvpncl_tuntap"));
307        fprintf(fp, "proto %s\n", nvram_safe_get("openvpncl_proto"));
308        fprintf(fp, "cipher %s\n", nvram_safe_get("openvpncl_cipher"));
309        fprintf(fp, "auth %s\n", nvram_safe_get("openvpncl_auth"));
310        fprintf(fp, "remote %s %s\n",
311                nvram_safe_get("openvpncl_remoteip"),
312                nvram_safe_get("openvpncl_remoteport"));
313        if (nvram_invmatch("openvpncl_auth", "none")) //not needed if we have no auth anyway
314                fprintf(fp, "tls-client\n");
315        if (nvram_invmatch("openvpncl_mtu", ""))
316                fprintf(fp, "tun-mtu %s\n", nvram_safe_get("openvpncl_mtu"));
317        if (nvram_invmatch("openvpncl_mssfix", "")
318            && nvram_match("openvpn_proto", "udp")) {
319                fprintf(fp, "mssfix\n");        //fragment=mssfix
320                fprintf(fp, "fragment %s\n",
321                        nvram_safe_get("openvpncl_mssfix"));
322        }
323        if (nvram_invmatch("openvpncl_lzo", "0"))
324                fprintf(fp, "comp-lzo %s\n",    //yes/no/adaptive/disable
325                        nvram_safe_get("openvpncl_lzo"));
326        if (nvram_match("openvpncl_certtype", "1"))
327                fprintf(fp, "ns-cert-type server\n");
328        if (nvram_match("openvpncl_proto", "udp"))
329                fprintf(fp, "fast-io\n");       //experimental!improving CPU efficiency by 5%-10%
330//      if (nvram_match("openvpncl_tuntap", "tun"))
331//              fprintf(fp, "tun-ipv6\n");      //enable ipv6 support. not supported on server in version 2.1.3
332        if (strlen(nvram_safe_get("openvpncl_tlsauth")) > 0)
333                fprintf(fp, "tls-auth /tmp/openvpncl/ta.key 1\n");
334        if (nvram_invmatch("openvpncl_tlscip", "0"))
335                fprintf(fp, "tls-cipher %s\n",
336                        nvram_safe_get("openvpncl_tlscip"));
337        /* for QOS */
338        if (nvram_invmatch("wshaper_enable", "0"))
339                fprintf(fp, "passtos\n");
340
341        fprintf(fp, "%s\n", nvram_safe_get("openvpncl_config"));
342        fclose(fp);
343        fp = fopen("/tmp/openvpncl/route-up.sh", "wb");
344        if (fp == NULL) {
345                return;
346        }
347        fprintf(fp, "#!/bin/sh\n");
348        //bridge tap interface to br0 when choosen
349        if (nvram_match("openvpncl_tuntap", "tap")
350            && nvram_match("openvpncl_bridge", "1")
351            && nvram_match("openvpncl_nat", "0")) {
352                fprintf(fp, "brctl addif br0 tap1\n"
353                        "ifconfig tap1 0.0.0.0 promisc up\n"
354                        "stopservice wshaper\n"
355                        "startservice wshaper\n");
356        } else {
357                if (nvram_match("openvpncl_tuntap", "tap")
358                    && strlen(nvram_safe_get("openvpncl_ip")) > 0)
359                        fprintf(fp, "ifconfig tap1 %s netmask %s up\n",
360                                nvram_safe_get("openvpncl_ip"),
361                                nvram_safe_get("openvpncl_mask"));
362         }
363        if (nvram_match("openvpncl_nat", "1"))
364                fprintf(fp,
365                        "iptables -I INPUT -i %s1 -j logaccept\n"
366                        "iptables -I POSTROUTING -t nat -o %s1 -j MASQUERADE\n",
367                        nvram_safe_get("openvpncl_tuntap"),
368                        nvram_safe_get("openvpncl_tuntap"));
369        else {
370                fprintf(fp,
371                        "iptables -I INPUT -i %s1 -j logaccept\n"
372                        "iptables -I FORWARD -i %s1 -j logaccept\n"
373                        "iptables -I FORWARD -o %s1 -j logaccept\n",
374                        nvram_safe_get("openvpncl_tuntap"),
375                        nvram_safe_get("openvpncl_tuntap"),
376                        nvram_safe_get("openvpncl_tuntap"));
377                }
378        if (strlen(nvram_safe_get("openvpncl_route")) > 0) {    //policy based routing
379                write_nvram("/tmp/openvpncl/policy_ips", "openvpncl_route");
380                fprintf(fp, "ip route add default via %s table 10\n",
381                        nvram_safe_get("wan_gateway"));
382                //sort -r /var/log/openvpncl |grep gateway             
383                fprintf(fp,
384                        "for IP in `cat /tmp/openvpncl/policy_ips` ; do\n"
385                        "       ip rule add from $IP table 10\n" "done\n");
386        }
387        if (nvram_match("block_multicast", "0") //block multicast on bridged vpns
388                && nvram_match("openvpncl_tuntap", "tap")
389                && nvram_match("openvpncl_bridge", "1")) {
390                fprintf(fp, "insmod ebtables\n"
391                        "insmod ebtable_filter\n"
392                        "insmod ebt_pkttype\n"
393                        "ebtables -I FORWARD -o tap1 --pkttype-type multicast -j DROP\n"
394                        "ebtables -I OUTPUT -o tap1 --pkttype-type multicast -j DROP\n"
395);
396        }
397        fprintf(fp, "startservice set_routes\n");
398        fclose(fp);
399       
400        fp = fopen("/tmp/openvpncl/route-down.sh", "wb");
401        if (fp == NULL)
402                return;
403        fprintf(fp, "#!/bin/sh\n");
404        if (nvram_match("openvpncl_tuntap", "tap")
405            && nvram_match("openvpncl_bridge", "1")
406            && nvram_match("openvpncl_nat", "0"))
407                fprintf(fp, "brctl delif br0 tap1\n" "ifconfig tap1 down\n");
408        else if (nvram_match("openvpncl_tuntap", "tap")
409                 && strlen(nvram_safe_get("openvpn_ip")) > 0)
410                fprintf(fp, "ifconfig tap1 down\n");
411        if (nvram_match("openvpncl_nat", "1"))
412                fprintf(fp,
413                        "iptables -D INPUT -i %s1 -j logaccept\n"
414                        "iptables -D POSTROUTING -t nat -o %s1 -j MASQUERADE\n",
415                        nvram_safe_get("openvpncl_tuntap"),
416                        nvram_safe_get("openvpncl_tuntap"));
417        else {
418                fprintf(fp,
419                        "iptables -D INPUT -i %s1 -j logaccept\n"
420                        "iptables -D FORWARD -i %s1 -j logaccept\n"
421                        "iptables -D FORWARD -o %s1 -j logaccept\n",
422                        nvram_safe_get("openvpncl_tuntap"),
423                        nvram_safe_get("openvpncl_tuntap"),
424                        nvram_safe_get("openvpncl_tuntap"));
425                }
426        if (strlen(nvram_safe_get("openvpncl_route")) > 0) {    //policy based routing
427                write_nvram("/tmp/openvpncl/policy_ips", "openvpncl_route");
428                fprintf(fp, "ip route del default via %s table 10\n",
429                        nvram_safe_get("wan_gateway"));
430                fprintf(fp,
431                        "for IP in `cat /tmp/openvpn/policy_ips` ; do\n"
432                        "       ip rule del from $IP table 10\n" "done\n");
433        }
434        if (nvram_match("block_multicast", "0") //block multicast on bridged vpns
435                && nvram_match("openvpncl_tuntap", "tap")
436                && nvram_match("openvpncl_bridge", "1")) {
437                fprintf(fp,
438                        "ebtables -D FORWARD -o tap1 --pkttype-type multicast -j DROP\n"
439                        "ebtables -D OUTPUT -o tap1 --pkttype-type multicast -j DROP\n"
440                        "#rmmod ebt_pkttype\n"
441                        "#rmmod ebtable_filter\n"
442                        "#rmmod ebtables\n");
443        }
444        fclose(fp);
445
446        chmod("/tmp/openvpncl/route-up.sh", 0700);
447        chmod("/tmp/openvpncl/route-down.sh", 0700);
448
449        if (nvram_match("use_crypto", "1"))
450                eval("openvpn", "--config",
451                     "/tmp/openvpncl/openvpn.conf", "--route-up",
452                     "/tmp/openvpn/route-up.sh", "--down-pre",
453                     "/tmp/openvpn/route-down.sh", "--daemon",
454                     "--engine", "cryptodev");
455        else
456                eval("openvpn", "--config",
457                     "/tmp/openvpncl/openvpn.conf", "--route-up",
458                     "/tmp/openvpncl/route-up.sh", "--down-pre",
459                     "/tmp/openvpncl/route-down.sh", "--daemon");
460
461        eval("stopservice", "wshaper");
462        eval("startservice", "wshaper");
463
464        return;
465}
466
467void stop_openvpn(void)
468{
469        if (stop_process("openvpn", "OpenVPN daemon (Client)")) {
470            stop_wshaper();
471            start_wshaper();
472        }
473}
474
475void stop_openvpn_wandone(void)
476{
477        if (nvram_invmatch("openvpncl_enable", "1"))
478                return;
479
480        if (stop_process("openvpn", "OpenVPN daemon (Client)")) {
481                stop_wshaper();
482                start_wshaper();
483        }
484}
485
486#endif
Note: See TracBrowser for help on using the repository browser.