Changeset 3779 in /cluster/svnroot


Ignore:
Timestamp:
Aug 7, 2012 12:40:15 AM (8 years ago)
Author:
skylar
Message:

nearly working, except for odd bccd-nic-setup dialogs (#729)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar/bccd-3.1.1/trees/usr/local/lib/site_perl/Bccd.pm

    r3778 r3779  
    6161                            'mask' => '255.255.255.0',
    6262                            'bcast'   => '192.168.3.255',
     63                                                        'net'   => '192.168.3.0',
    6364                            'dhcp'    => 0,
    6465                            'bccdnet' => 1,
     
    20402041    else {
    20412042        print $DCONF "allow bootp;\nallow booting;\n\n";
    2042         print $DCONF "# This is a total hack to get DHCP to work with interface aliases\n";
    2043         print $DCONF "subnet 0.0.0.0 netmask 0.0.0.0 {\n\n";
     2043                print $DCONF "# This is a total hack to get DHCP to work with interface aliases\n";
     2044                print $DCONF "subnet $BCCD_NET->{'net'} netmask $BCCD_NET->{'mask'} {\n\n";
     2045                print $DCONF "authoritative;";
    20442046        print $DCONF "\toption subnet-mask $pubnet->{'mask'};\n";
    20452047        print $DCONF "\toption broadcast-address $pubnet->{'bcast'};\n";
     
    20512053        print $DCONF "}\n";
    20522054        }
     2055
     2056        # Include the base NIC (no alias) as well
     2057        my $base_dhcpnic = $dhcpnic;
     2058        $base_dhcpnic =~ s{:\d+$}{};
     2059
     2060        my $base_dhcpnic_ip = new NetAddr::IP($nic_conf->{$base_dhcpnic}->{'ipaddr'},
     2061                                                                $nic_conf->{$base_dhcpnic}->{'mask'});
     2062
     2063        print $DCONF "subnet ".$base_dhcpnic_ip->network()." ";
     2064        print $DCONF "$nic_conf->{$base_dhcpnic}->{'mask'} {\n";
     2065        print $DCONF "\tallow members of \"bccd-nodes\";\n";
     2066        print $DCONF "}\n";
    20532067   
    20542068    close($DCONF);
     
    23332347                $nic_conf->{$nic}->{'dhcp'} = 0;
    23342348            }
    2335             if($nic_conf->{$nic}->{'dhcp'} == 0 && !defined($nic_conf->{$nic}->{'ipaddr'})
     2349            if(($nic_conf->{$nic}->{'dhcp'} == 0) && !defined($nic_conf->{$nic}->{'ipaddr'})
    23362350             && ! -e '/testmode'
    23372351                         && ! $d->yesno(text=>"No DHCP for $nic, skip?")) {
     
    25052519                }
    25062520                elsif($line =~ m{^\s+option subnet-mask\s+((?:\d{1,3}\.){3}\d{1,3});$}) {
    2507                         $ip_info->{'netmask'} = $1;
     2521                        $ip_info->{'mask'} = $1;
    25082522                }
    25092523        }
Note: See TracChangeset for help on using the changeset viewer.