/[smecontribs]/rpms/smeserver-openvpn-bridge/contribs7/smeserver-openvpn-bridge-2.0-enhance_routes_push.patch
ViewVC logotype

Annotation of /rpms/smeserver-openvpn-bridge/contribs7/smeserver-openvpn-bridge-2.0-enhance_routes_push.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue Oct 26 10:06:59 2010 UTC (14 years ago) by vip-ire
Branch: MAIN
CVS Tags: smeserver-openvpn-bridge-2_0-43_el4_sme, smeserver-openvpn-bridge-2_0-48_el4_sme, smeserver-openvpn-bridge-2_0-46_el4_sme, smeserver-openvpn-bridge-2_0-45_el4_sme, smeserver-openvpn-bridge-2_0-40_el4_sme, smeserver-openvpn-bridge-2_0-47_el4_sme, smeserver-openvpn-bridge-2_0-42_el4_sme, smeserver-openvpn-bridge-2_0-41_el4_sme, HEAD
* Tue Oct 26 2010 Daniel B. <daniel@firewall-services.com> 2.0-40.sme
- Add PassTOS DB key to enable/disable passtos
- Enhance routes push (work with s2s contrib)

1 vip-ire 1.1 --- smeserver-openvpn-bridge-2.0/root/etc/e-smith/templates/etc/openvpn/bridge/openvpn.conf/60options.enhance_routes_push 2010-10-26 11:22:59.000000000 +0200
2     +++ smeserver-openvpn-bridge-2.0/root/etc/e-smith/templates/etc/openvpn/bridge/openvpn.conf/60options 2010-10-26 11:29:18.000000000 +0200
3     @@ -9,14 +9,7 @@
4     my $proto = ${'openvpn-bridge'}{protocol} || 'udp';
5     my $duplicate = ${'openvpn-bridge'}{duplicateCN} || 'disabled';
6     my $passtos = ${'openvpn-bridge'}{PassTOS} || 'enabled';
7     -my $pushRoutes = ${'openvpn-bridge'}{PushLocalNetworks} || 'enabled';
8    
9     -use esmith::NetworksDB;
10     -my $ndb = esmith::NetworksDB->open_ro() ||
11     - die('Can not open Networks DB');
12     -
13     -my @networks = $ndb->networks();
14     -
15     if ($proto eq 'tcp'){
16     $mtuTest = 'disabled';
17     $fragment = '';
18     @@ -30,22 +23,6 @@
19    
20     HERE
21    
22     -if ($pushRoutes eq 'enabled'){
23     - foreach my $network (@networks) {
24     - if ($network->prop('Router')) {
25     - $OUT .= sprintf("push \"route %s %s %s\"\n",
26     - $network->key(),
27     - $network->prop('Mask'),
28     - $network->prop('Router')
29     - );
30     - }
31     - }
32     -}
33     -
34     -if ($redirectGW eq 'always'){
35     - $OUT .= "push \"redirect-gateway def1\"\n";
36     -}
37     -
38     if ($mtuTest eq 'enabled'){
39     $OUT .= "mtu-test\n";
40     }
41     --- smeserver-openvpn-bridge-2.0/root/etc/e-smith/templates/etc/openvpn/bridge/openvpn.conf/65routes.enhance_routes_push 2010-10-26 11:23:31.000000000 +0200
42     +++ smeserver-openvpn-bridge-2.0/root/etc/e-smith/templates/etc/openvpn/bridge/openvpn.conf/65routes 2010-10-26 12:00:30.000000000 +0200
43     @@ -0,0 +1,32 @@
44     +# Routes
45     +
46     +{
47     +
48     +my $pushRoutes = ${'openvpn-bridge'}{PushLocalNetworks} || 'enabled';
49     +my $redirectGW = ${'openvpn-bridge'}{redirectGW} || 'PerClient';
50     +
51     +use esmith::NetworksDB;
52     +my $ndb = esmith::NetworksDB->open_ro() ||
53     + die('Can not open Networks DB');
54     +
55     +my @networks = $ndb->networks();
56     +
57     +if ($redirectGW eq 'always'){
58     + $OUT .= "push \"redirect-gateway def1\"\n";
59     +}
60     +elsif ($pushRoutes eq 'enabled'){
61     + foreach my $network (@networks) {
62     + my $route = '';
63     + my $addr = $network->key;
64     + my $mask = $network->prop('Mask');
65     + my $gw = $network->prop('Router') || '';
66     + my $vpn = $network->prop('VPN') || '';
67     + if ($gw ne '') {
68     + $route .= "push \"route $addr $mask";
69     + $route .= " $gw" if ($vpn eq '');
70     + $OUT .= "$route\"\n";
71     + }
72     + }
73     +}
74     +
75     +}

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed