From eb5c7ca79295056aaf93658c3ffe7d44101b8e40 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 2 Jun 2008 12:00:46 +0000 Subject: [PATCH] -Have dhcp/networks table not automatically pick up multicast networks git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1539 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/dhcp.pm | 16 ++++++++++++---- xCAT-server-2.0/lib/xcat/plugins/networks.pm | 4 +++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/dhcp.pm b/xCAT-server-2.0/lib/xcat/plugins/dhcp.pm index f17ffed61..00e813993 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/dhcp.pm @@ -379,7 +379,9 @@ sub process_request foreach (@nrn) { my @ent = split /\s+/; - if ($ent[0] eq "169.254.0.0") + my $firstoctet = $ent[0]; + $firstoctet =~ s/^(\d+)\..*/$1/; + if ($ent[0] eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239)) { next; } @@ -463,7 +465,9 @@ sub process_request foreach (@nrn) { my @line = split /\s+/; - if ($ent[0] eq "169.254.0.0") + my $firstoctet = $line[0]; + $firstoctet =~ s/^(\d+)\..*/$1/; + if ($line[0] eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239)) { next; } @@ -484,7 +488,9 @@ sub addnet my $net = shift; my $mask = shift; my $nic; - if ($net eq "169.254.0.0") { + my $firstoctet = $net; + $firstoctet =~ s/^(\d+)\..*/$1/; + if ($net eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239)) { return; } unless (grep /\} # $net\/$mask subnet_end/, @dhcpconf) @@ -493,7 +499,9 @@ sub addnet foreach (@nrn) { # search for relevant NIC my @ent = split /\s+/; - if ($ent[0] eq "169.254.0.0") + $firstoctet = $ent[0]; + $firstoctet =~ s/^(\d+)\..*/$1/; + if ($ent[0] eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239)) { next; } diff --git a/xCAT-server-2.0/lib/xcat/plugins/networks.pm b/xCAT-server-2.0/lib/xcat/plugins/networks.pm index d60125a19..e359c5547 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/networks.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/networks.pm @@ -58,7 +58,9 @@ sub process_request my $mgtifname; my $gw; my @ent = split /\s+/, $_; - if ($ent[0] eq "169.254.0.0") + my $firstoctet = $ent[0]; + $firstoctet =~ s/^(\d+)\..*/$1/; + if ($ent[0] eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239)) { next; }