diff --git a/src/etc/inc/plugins.inc.d/dpinger.inc b/src/etc/inc/plugins.inc.d/dpinger.inc index 56295dd9a..9271f3866 100644 --- a/src/etc/inc/plugins.inc.d/dpinger.inc +++ b/src/etc/inc/plugins.inc.d/dpinger.inc @@ -3,7 +3,7 @@ /* * Copyright (C) 2020 Deciso B.V. * Copyright (C) 2018 Martin Wasley - * Copyright (C) 2016-2019 Franco Fichtner + * Copyright (C) 2016-2021 Franco Fichtner * Copyright (C) 2008 Bill Marquette * Copyright (C) 2008 Seth Mos * Copyright (C) 2010 Ermal Luçi @@ -142,7 +142,7 @@ function dpinger_configure_do($verbose = false, $gwname = null) } } if ($gwifip == null) { - $gwifip = $ifconfig_details[$gateway['if']]['ipv4'][0]['ipaddr']; + list ($gwifip) = interfaces_primary_address($gateway['interface'], $ifconfig_details); log_error(sprintf('Choose to bind %s on %s since we could not find a proper match.', $name, $gwifip)); } }