summaryrefslogtreecommitdiff
path: root/templates/system
diff options
context:
space:
mode:
authorDaniil Baturin <daniil.baturin@vyatta.com>2011-10-31 23:03:11 +0700
committerDaniil Baturin <daniil.baturin@vyatta.com>2011-10-31 23:03:11 +0700
commitad00f08f0a2caeda317fa15fef43ae677681c1f5 (patch)
tree4bf133459a36b7061fed1468abcca9178260090b /templates/system
parentaeaf3d57035edb53d6b829c3810e42b44dcf845f (diff)
downloadvyatta-cfg-system-ad00f08f0a2caeda317fa15fef43ae677681c1f5.tar.gz
vyatta-cfg-system-ad00f08f0a2caeda317fa15fef43ae677681c1f5.zip
Terrible workaround for depencency between PPTP and GRE modules.
Diffstat (limited to 'templates/system')
-rw-r--r--templates/system/conntrack/modules/gre/disable/node.def11
-rw-r--r--templates/system/conntrack/modules/pptp/disable/node.def12
-rw-r--r--templates/system/conntrack/node.def2
3 files changed, 19 insertions, 6 deletions
diff --git a/templates/system/conntrack/modules/gre/disable/node.def b/templates/system/conntrack/modules/gre/disable/node.def
index 2ca281de..f6f95460 100644
--- a/templates/system/conntrack/modules/gre/disable/node.def
+++ b/templates/system/conntrack/modules/gre/disable/node.def
@@ -1,8 +1,15 @@
help: Disable GRE connection tracking
# GRE shouldn't be disabled when PPTP is enabled because PPTP depends on it
-create: cli-shell-api existsEffective system conntrack modules pptp disable
+create: cli-shell-api exists system conntrack modules pptp disable
if [ $? == 0 ]; then
+ # Unload PPTP modules if they are loaded
+ lsmod | grep -e "^nf_nat_pptp" 2>&1 >/dev/null
+ if [ $? == 0 ]; then
+ sudo rmmod nf_nat_pptp
+ sudo rmmod nf_conntrack_pptp
+ fi
+ # And GRE modules then
sudo rmmod nf_nat_proto_gre
sudo rmmod nf_conntrack_proto_gre
else
@@ -11,4 +18,4 @@ create: cli-shell-api existsEffective system conntrack modules pptp disable
fi
delete: sudo modprobe nf_conntrack_proto_gre
- sudo modprobe nf_nat_proto_gre \ No newline at end of file
+ sudo modprobe nf_nat_proto_gre
diff --git a/templates/system/conntrack/modules/pptp/disable/node.def b/templates/system/conntrack/modules/pptp/disable/node.def
index 00a2071e..4ffd980c 100644
--- a/templates/system/conntrack/modules/pptp/disable/node.def
+++ b/templates/system/conntrack/modules/pptp/disable/node.def
@@ -1,7 +1,13 @@
help: Disable PPTP connection tracking
-create: sudo rmmod nf_nat_pptp
- sudo rmmod nf_conntrack_pptp
+create: cli-shell-api exists system conntrack modules gre disable
+ if [ $? == 0 ]; then
+ # Do nothing, this case is handled in GRE module templates
+ :;
+ else
+ sudo rmmod nf_nat_pptp
+ sudo rmmod nf_conntrack_pptp
+ fi
# PPTP shouldn't be enabled when GRE is disabled because PPTP depends on it
delete: cli-shell-api exists system conntrack modules gre disable
@@ -11,4 +17,4 @@ delete: cli-shell-api exists system conntrack modules gre disable
else
sudo modprobe nf_conntrack_pptp
sudo modprobe nf_nat_pptp
- fi \ No newline at end of file
+ fi
diff --git a/templates/system/conntrack/node.def b/templates/system/conntrack/node.def
index b9aec69d..53488ae3 100644
--- a/templates/system/conntrack/node.def
+++ b/templates/system/conntrack/node.def
@@ -21,4 +21,4 @@ delete: # set conntrack table size to standard 16384 entries if conntrack settin
# need to restart conntrackd with updated conntrack table size
if cli-shell-api existsActive service conntrack-sync; then
sudo /opt/vyatta/sbin/vyatta-conntrack-sync.pl --action=enable
- fi \ No newline at end of file
+ fi