diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | debian/control | 3 | ||||
-rw-r--r-- | src/lbdata.cc | 2 | ||||
-rw-r--r-- | src/lbdecision.cc | 1 | ||||
-rw-r--r-- | src/lboutput.cc | 1 | ||||
-rw-r--r-- | src/loadbalance.cc | 3 | ||||
-rw-r--r-- | src/main.cc | 24 |
8 files changed, 36 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am index b1dedce..321c931 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -dhcphookdir = /etc/dhcp3/dhclient-exit-hooks.d +dhcphookdir = /etc/dhcp/dhclient-exit-hooks.d ppphookdir = /etc/ppp/ip-up.d pppwanlbdir = /var/run/load-balance/ppp cfgdir = $(datadir)/vyatta-cfg/templates diff --git a/debian/changelog b/debian/changelog index b64b917..a06ef86 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +vyatta-wanloadbalance (0.13.68+vyos2+current1) unstable; urgency=medium + + [ Thomas Jepp ] + * Fix build depends. + * Fix build failures when building for jessie. + + [ Kim Hagen ] + + -- Kim Hagen <kim.sidney@gmail.com> Sun, 24 Jan 2016 15:27:39 -0500 + vyatta-wanloadbalance (0.13.68+vyos2+lithium9) unstable; urgency=low [ Alex Harpin ] diff --git a/debian/control b/debian/control index 10345bc..0b881e9 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: vyatta-wanloadbalance Section: contrib/net Priority: extra Maintainer: VyOS Package Maintainers <maintainers@vyos.net> -Build-Depends: debhelper (>= 5), autotools-dev +Build-Depends: debhelper (>= 5), autotools-dev, automake, autoconf, cpio, libtool Standards-Version: 3.7.2 Package: vyatta-wanloadbalance @@ -10,7 +10,6 @@ Architecture: any Depends: sed (>= 4.1.5), perl (>= 5.8.8), procps (>= 1:3.2.7-3), - vyatta-quagga | quagga, vyatta-cfg (>= 0.15.33), vyatta-cfg-firewall, vyatta-op, diff --git a/src/lbdata.cc b/src/lbdata.cc index 99c36e7..60578de 100644 --- a/src/lbdata.cc +++ b/src/lbdata.cc @@ -332,7 +332,7 @@ LBData::update_dhcp_nexthop() LBData::InterfaceHealthIter h_iter = _iface_health_coll.begin(); while (h_iter != _iface_health_coll.end()) { if (h_iter->second._nexthop == "dhcp") { - string file("/var/lib/dhcp3/dhclient_"+h_iter->first+"_lease"); + string file("/var/lib/dhcp/dhclient_"+h_iter->first+"_lease"); FILE *fp = fopen(file.c_str(),"r"); if (fp) { char str[1025]; diff --git a/src/lbdecision.cc b/src/lbdecision.cc index a86a878..fd5fd62 100644 --- a/src/lbdecision.cc +++ b/src/lbdecision.cc @@ -13,6 +13,7 @@ #include <net/if.h> #include <string.h> #include <stdlib.h> +#include <unistd.h> #include <sys/types.h> #include <sys/ioctl.h> diff --git a/src/lboutput.cc b/src/lboutput.cc index 28eb001..d146d8e 100644 --- a/src/lboutput.cc +++ b/src/lboutput.cc @@ -9,6 +9,7 @@ #include <sys/time.h> #include <time.h> #include <syslog.h> +#include <unistd.h> #include <iostream> diff --git a/src/loadbalance.cc b/src/loadbalance.cc index 4f42388..80eab13 100644 --- a/src/loadbalance.cc +++ b/src/loadbalance.cc @@ -6,6 +6,7 @@ * by the Free Software Foundation. */ #include <string> +#include <unistd.h> #include "lbpathtest.hh" #include "loadbalance.hh" @@ -114,6 +115,6 @@ LoadBalance::output() void LoadBalance::sleep() { - ::sleep(5); + usleep(5000000); } diff --git a/src/main.cc b/src/main.cc index 05b1fa7..2be1edb 100644 --- a/src/main.cc +++ b/src/main.cc @@ -12,14 +12,16 @@ #include <syslog.h> #include <stdio.h> #include "stdlib.h" +#include <unistd.h> #include <iostream> +#include <unistd.h> +#include <grp.h> #include "loadbalance.hh" bool g_check_path = false; LoadBalance *g_lb = NULL; pid_t pid_output (const char *path); - static void usage() { cout << "lb -ftviodh" << endl; @@ -105,7 +107,7 @@ int main(int argc, char* argv[]) cout << "Configuration file is empty" << endl; exit(0); } - + int s = 0; if (daemon) { if (fork() != 0) { @@ -119,7 +121,7 @@ int main(int argc, char* argv[]) } g_lb = new LoadBalance(debug, output_path); - + bool success = g_lb->set_conf(c_file); if (success == false) { syslog(LOG_ERR, "wan_lb: error loading configuration file: %s", c_file.c_str()); @@ -134,9 +136,21 @@ int main(int argc, char* argv[]) cout << "STARTING CYCLE" << endl; } + // Get config owners group GID and set the GID to it to avoid + // ruining the permissions of the running config if hooks + // execute VyOS configuration commands + group* vyattacfg_group = getgrnam("vyattacfg"); + if (vyattacfg_group == NULL) { + syslog(LOG_ERR, "Could not get vyattacfg group ID, exiting"); + exit(1); + } + gid_t cfg_gid = vyattacfg_group->gr_gid; + setgid(cfg_gid); + + g_lb->init(); - + //signal handler here // sighup... signal(SIGINT, sig_end); @@ -191,7 +205,7 @@ pid_output (const char *path) oldumask = umask(0777 & ~PIDFILE_MASK); fp = fopen (path, "w"); - if (fp != NULL) + if (fp != NULL) { fprintf (fp, "%d\n", (int) pid); fclose (fp); |