1 |
diff -up e-smith-base-5.2.0/root/usr/lib/perl5/site_perl/esmith/console/configure.pm.checkIPOverlap e-smith-base-5.2.0/root/usr/lib/perl5/site_perl/esmith/console/configure.pm |
2 |
--- e-smith-base-5.2.0/root/usr/lib/perl5/site_perl/esmith/console/configure.pm.checkIPOverlap 2008-08-20 23:17:24.000000000 +0200 |
3 |
+++ e-smith-base-5.2.0/root/usr/lib/perl5/site_perl/esmith/console/configure.pm 2009-10-24 20:32:00.000000000 +0200 |
4 |
@@ -1049,7 +1049,38 @@ |
5 |
{ |
6 |
if ( isValidIP($choice) ) |
7 |
{ |
8 |
- $db->set_value('ExternalNetmask', cleanIP($choice)); |
9 |
+ # Check for overlapping ranges in external and internal interface IP and netmasks |
10 |
+ |
11 |
+ # Retrieve the local IP/mask setting |
12 |
+ my $localAddress = $db->get_value('LocalIP'); |
13 |
+ my $localNetmask = $db->get_value('LocalNetmask'); |
14 |
+ |
15 |
+ # Retrieve the external IP/mask setting |
16 |
+ my $externalAddress = $db->get_value('ExternalIP'); |
17 |
+ my $externalNetmask = cleanIP($choice); |
18 |
+ |
19 |
+ if ( ipv4_in_network($localAddress, $localNetmask, $externalAddress, $externalNetmask) ) |
20 |
+ { |
21 |
+ |
22 |
+ ($rc, $choice) = $console->message_page |
23 |
+ ( |
24 |
+ title => gettext("Invalid address ranges"), |
25 |
+ text => gettext( |
26 |
+ "Internal address range overlaps external address range" . |
27 |
+ "\n\n". |
28 |
+ "Local interface: $localAddress/$localNetmask" . |
29 |
+ "\n" . |
30 |
+ "External interface: $externalAddress/$externalNetmask" . |
31 |
+ "\n\n". |
32 |
+ "Please review your settings." |
33 |
+ ) |
34 |
+ ); |
35 |
+ |
36 |
+ goto STATIC_IP; |
37 |
+ |
38 |
+ } |
39 |
+ |
40 |
+ $db->set_value('ExternalNetmask', $externalNetmask); |
41 |
goto STATIC_GATEWAY; |
42 |
} |
43 |
} |