summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am5
-rw-r--r--scripts/ppp/ppp-wanlb7
-rw-r--r--src/lbdata.cc11
-rw-r--r--templates/load-balancing/wan/interface-health/node.def10
-rw-r--r--templates/load-balancing/wan/rule/node.tag/interface/node.def10
5 files changed, 23 insertions, 20 deletions
diff --git a/Makefile.am b/Makefile.am
index e97cc1b..e0f5025 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,6 @@
dhcphookdir = /etc/dhcp3/dhclient-exit-hooks.d
+ppphookdir = /etc/ppp/ip-up.d
+pppwanlbdir = /var/load-balance/ppp
cfgdir = $(datadir)/vyatta-cfg/templates
bin_sudo_usersdir = $(bindir)/sudo-users
curverdir = $(sysconfdir)/config-migrate/current
@@ -17,6 +19,7 @@ bin_sudo_users_SCRIPTS = scripts/vyatta-wlb-status
bin_sudo_users_SCRIPTS += scripts/vyatta-wlb-connection.pl
dhcphook_SCRIPTS = scripts/dhcp/dhcp-wanlb
+ppphook_SCRIPTS = scripts/ppp/ppp-wanlb
curver_DATA = cfg-version/wanloadbalance@1
@@ -39,6 +42,8 @@ cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \
install-exec-hook:
mkdir -p $(DESTDIR)$(dhcphookdir)
+ mkdir -p $(DESTDIR)$(pppwanlbdir)
+ mkdir -p $(DESTDIR)$(ppphookdir)
mkdir -p $(DESTDIR)$(cfgdir)
cd templates; $(cpiop) $(DESTDIR)$(cfgdir)
find etc ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | cpio -0pd $(DESTDIR) \ No newline at end of file
diff --git a/scripts/ppp/ppp-wanlb b/scripts/ppp/ppp-wanlb
new file mode 100644
index 0000000..7430789
--- /dev/null
+++ b/scripts/ppp/ppp-wanlb
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+pid=/var/run/vyatta/wlb.pid
+if [ -f $pid ]; then
+ echo $5 > /var/load-balance/ppp/$6
+ kill -s SIGUSR2 $( cat $pid ) 2>/dev/null
+fi
diff --git a/src/lbdata.cc b/src/lbdata.cc
index 7226b84..2872258 100644
--- a/src/lbdata.cc
+++ b/src/lbdata.cc
@@ -346,6 +346,17 @@ LBData::update_dhcp_nexthop()
}
fclose(fp);
}
+ else {
+ //check if this is a ppp interface
+ string pppfile("/var/load-balance/ppp/"+h_iter->first);
+ FILE *fp = fopen(pppfile.c_str(),"r");
+ if (fp) {
+ char str[1025];
+ if (fgets(str, 1024, fp)) {
+ h_iter->second._dhcp_nexthop = string(str);
+ }
+ }
+ }
}
++h_iter;
}
diff --git a/templates/load-balancing/wan/interface-health/node.def b/templates/load-balancing/wan/interface-health/node.def
index 24a05c0..d393140 100644
--- a/templates/load-balancing/wan/interface-health/node.def
+++ b/templates/load-balancing/wan/interface-health/node.def
@@ -1,13 +1,3 @@
tag:
type: txt
help: Set interface name
-syntax:expression: exec " \
- if [ -z \"`ip link | grep $VAR(@)`\" ]; then \
- echo Invalid interface [$VAR(@)]; \
- exit 1 ; \
- fi ; "
-allowed: for dev in /sys/class/net/*;
- do if [[ ! $dev =~ "net/lo" ]]; then
- echo -n ${dev##*/} " "
- fi
- done
diff --git a/templates/load-balancing/wan/rule/node.tag/interface/node.def b/templates/load-balancing/wan/rule/node.tag/interface/node.def
index 24a05c0..d393140 100644
--- a/templates/load-balancing/wan/rule/node.tag/interface/node.def
+++ b/templates/load-balancing/wan/rule/node.tag/interface/node.def
@@ -1,13 +1,3 @@
tag:
type: txt
help: Set interface name
-syntax:expression: exec " \
- if [ -z \"`ip link | grep $VAR(@)`\" ]; then \
- echo Invalid interface [$VAR(@)]; \
- exit 1 ; \
- fi ; "
-allowed: for dev in /sys/class/net/*;
- do if [[ ! $dev =~ "net/lo" ]]; then
- echo -n ${dev##*/} " "
- fi
- done