Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mxstartup2mxconfig: Skip unresolvable ip aliases in corrupted mxstart…
…up config
  • Loading branch information
mariux committed Jan 10, 2013
1 parent 8fc9fb4 commit 96b453c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions mxstartup2mxconfig
Expand Up @@ -147,9 +147,18 @@ sub parse_ips {

# printf "ip = $_\n";
# printf "todest = $_todest\n";

$ip = inet_ntoa(scalar gethostbyname($_));
$_todest = inet_ntoa(scalar gethostbyname($_todest));

if (! ($tmphostname = gethostbyname($_)) ) {
printf STDERR "mxvip::$name *ERROR* Can't resolve '$_'. Skipping.\n";
next;
}
$ip = inet_ntoa($tmphostname);

if (! ($tmphostname = gethostbyname($_todest)) ) {
printf STDERR "mxvip::$name *ERROR* Can't resolve '$_'. Skipping.\n";
next;
}
$_todest = inet_ntoa($tmphostname);

$H->{$ip} = { device => $device, addressprefix => $addressprefix, ports => {%ports}, todest => $_todest };
}
Expand Down

0 comments on commit 96b453c

Please sign in to comment.