Skip to content

Commit

Permalink
dpinger: address is an array, expand after check
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Jan 20, 2021
1 parent 69b6f7a commit 96b34bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/etc/inc/plugins.inc.d/dpinger.inc
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ function dpinger_configure_do($verbose = false, $gwname = null)
break;
}
}
if ($gwifip == null) {
$gwifip = $ifconfig_details[$gateway['if']]['ipv4'][0];
if ($gwifip == null && !empty($ifconfig_details[$gateway['if']]['ipv4'][0])) {
$gwifip = $ifconfig_details[$gateway['if']]['ipv4'][0]['ipaddr'];
log_error(sprintf('Choose to bind %s on %s since we could not find a proper match.', $name, $gwifip));
}
}
Expand Down

0 comments on commit 96b34bb

Please sign in to comment.