Here is a patch on mkdhcpconf that prevent mkdhcpconf to fail when trying to 
parse and handle an unconfigured network interface.


Index: pkgsrc/systeminstaller-oscar/trunk/bin/mkdhcpconf
===================================================================
--- pkgsrc/systeminstaller-oscar/trunk/bin/mkdhcpconf	(révision 9443)
+++ pkgsrc/systeminstaller-oscar/trunk/bin/mkdhcpconf	(copie de travail)
@@ -163,11 +163,15 @@
 foreach my $int (@INTS) {
 	unless (($int eq "lo") || ($int =~ /:\d+$/) || ($int eq $config->interface)) {
 		my ($ip,$bcast,$mask) = find_internal_ip($int);
-		$mask ||= "255.255.255.0"; # ensure non-null mask
-		my $block = new Net::Netmask ($ip,$mask);
-		my $net = $block->base();
-		print OUTFILE "\n# This entry ignores requests on $int...\n";
-		print OUTFILE "subnet $net netmask $mask {\n\tnot authoritative;\n}\n";
+		if ( $ip =~ /\s*$/ ) { # interface not configured
+			print OUTFILE "\n# Interface $int is not configured\n";
+		} else {
+			$mask ||= "255.255.255.0"; # ensure non-null mask
+			my $block = new Net::Netmask ($ip,$mask);
+			my $net = $block->base();
+			print OUTFILE "\n# This entry ignores requests on $int...\n";
+			print OUTFILE "subnet $net netmask $mask {\n\tnot authoritative;\n}\n";
+		}
 	}
 }
 close(OUTFILE);
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to