summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2016-06-28 21:12:28 -0500
committerChris Buechler <cmb@pfsense.org>2016-06-28 21:12:28 -0500
commit5f93d5f1725ac82b7ad3bc2d7c116f78029fbead (patch)
tree884a1c35a50fa741252388814da9b8df59a9fa3d
parentef7c3a63739f34c23555b4d5ccaf1e92113f0d1f (diff)
parent40588fc44bb80727369afa936e92bebe906b9b9a (diff)
downloadpfsense-5f93d5f1725ac82b7ad3bc2d7c116f78029fbead.zip
pfsense-5f93d5f1725ac82b7ad3bc2d7c116f78029fbead.tar.gz
Merge pull request #3027 from dhoffend/ticket-6505
-rw-r--r--src/etc/inc/gwlb.inc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc
index cbdceb5..823d243 100644
--- a/src/etc/inc/gwlb.inc
+++ b/src/etc/inc/gwlb.inc
@@ -79,7 +79,7 @@ function running_dpinger_processes() {
}
foreach ($pidfiles as $pidfile) {
- if (preg_match('/^dpinger_(.+)_([^_]+)_([^_]+)\.pid$/',
+ if (preg_match('/^dpinger_(.+)~([^~]+)~([^~]+)\.pid$/',
basename($pidfile), $matches)) {
$socket_file = preg_replace('/\.pid$/', '.sock',
$pidfile);
@@ -128,10 +128,16 @@ function start_dpinger($gateway) {
$dpinger_defaults = return_dpinger_defaults();
- $pidfile = "{$g['varrun_path']}/dpinger_{$gateway['name']}_" .
- "{$gateway['gwifip']}_{$gateway['monitor']}.pid";
- $socket = "{$g['varrun_path']}/dpinger_{$gateway['name']}_" .
- "{$gateway['gwifip']}_{$gateway['monitor']}.sock";
+ $prefix = "{$g['varrun_path']}/dpinger_{$gateway['name']}~" .
+ "{$gateway['gwifip']}~{$gateway['monitor']}";
+ # dpinger socket path should not be longer then uaddr.sun_path
+ if (strlen($pidfile) > 95) {
+ $prefix = "{$g['varrun_path']}/dpinger_{$gateway['name']}~" .
+ substr(md5($gateway['gwifip']),0,8) . "~" .
+ $gateway['monitor'];
+ }
+ $pidfile = $prefix . ".pid";
+ $socket = $prefix . ".sock";
$alarm_cmd = "{$g['etc_path']}/rc.gateway_alarm";
$params = "-S "; /* Log warnings via syslog */
OpenPOWER on IntegriCloud