mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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
This commit is contained in:
parent
dca9eafb0e
commit
69eca02c01
@ -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 */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user