summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/gwlb.inc
diff options
context:
space:
mode:
authorDaniel Hoffend <dh@dotlan.net>2016-06-29 01:21:39 +0200
committerDaniel Hoffend <dh@dotlan.net>2016-06-29 01:21:39 +0200
commit40588fc44bb80727369afa936e92bebe906b9b9a (patch)
tree884a1c35a50fa741252388814da9b8df59a9fa3d /src/etc/inc/gwlb.inc
parentb225d003e989dac03da50e1906d9519ff906af62 (diff)
downloadpfsense-40588fc44bb80727369afa936e92bebe906b9b9a.zip
pfsense-40588fc44bb80727369afa936e92bebe906b9b9a.tar.gz
Shorten gwifip if whole socket path exceeds 100 chars
dpinger stopps with an error when the socketname exceeds over (around) 100 characters. The dpinger will not start and not deliver monitoring results to the WebUI. These long socket names can get created when using link-local addresses and long gateway names / interface scopes. See Ticket 6505
Diffstat (limited to 'src/etc/inc/gwlb.inc')
-rw-r--r--src/etc/inc/gwlb.inc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc
index 998319d..823d243 100644
--- a/src/etc/inc/gwlb.inc
+++ b/src/etc/inc/gwlb.inc
@@ -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