Skip to content

Commit

Permalink
Guard against interfaces without set address
Browse files Browse the repository at this point in the history
  • Loading branch information
javierag committed Mar 6, 2013
1 parent 53839a1 commit 6302bec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions main/dns/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
HEAD
+ Guard against interfaces without set address
+ Rename domain if exists when changing it in System -> General
+ Remove depends on users and samba to avoid deep recursion
+ Use API to retrieve foreign model value
Expand Down
18 changes: 15 additions & 3 deletions main/dns/src/EBox/DNS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,15 @@ sub _intnets
my @intnets = ();

if (defined($intnets_string)) {
$intnets_string = s/\s//g;
@intnets = split(',', $intnets_string);
my $cidrName = __x('Value from {key} in configuration file {conf}',
key => DNS_INTNETS,
value => DNS_CONF_FILE,
);
foreach my $net (@intnets) {
EBox::Validate::checkCIDR($net, $cidrName);
}
}

return \@intnets;
Expand All @@ -991,9 +999,13 @@ sub _internalLocalNets
my @localNets = map {
my $iface = $_;
my $net = $network->ifaceNetwork($iface);
my $fullmask = $network->ifaceNetmask($iface);
my $mask = EBox::NetWrappers::bits_from_mask($fullmask);
("$net/$mask");
if ($net) {
my $fullmask = $network->ifaceNetmask($iface);
my $mask = EBox::NetWrappers::bits_from_mask($fullmask);
("$net/$mask");
} else {
()
}
} @{ $network->InternalIfaces };
return \@localNets;
}
Expand Down

0 comments on commit 6302bec

Please sign in to comment.