From 91c764484d006f1d33b2d114c809fe19ff374a82 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 21 May 2010 00:54:05 +0000 Subject: [PATCH] -Prevent ddns induced by PXE (still won't help floating Windows<->Linux multiboot, that requires fixed-address for ipv4) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6190 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 6d7322d64..21341c7d8 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1048,6 +1048,12 @@ sub addnet { push @netent, " option domain-name-servers $nameservers;\n"; } + push @netent, "zone $domain. {\n"; + my $ddnserver = $nameservers; + $ddnsserver =~ s/,.*//; + push @netent, "$domain. {\n"; + push @netent, " primary $ddnserver; key xcat_key; \n"; + push @netent, " }\n"; my $tmpmaskn = unpack("N", inet_aton($mask)); my $maskbits = 32; while (not ($tmpmaskn & 1)) { @@ -1230,6 +1236,7 @@ sub newconfig push @dhcpconf, "omapi-port 7911;\n"; #Enable omapi... push @dhcpconf, "key xcat_key {\n"; push @dhcpconf, " algorithm hmac-md5;\n"; + push @dhcpconf, ('class "pxe" {'."\n"," match if substring (option vendor-class-identefier, 0, 9) = \"PXEclient\";\n"," ddns-updates off;\n"," max-lease-time 600;\n"); (my $passent) = $passtab->getAttribs({key => 'omapi', username => 'xcat_key'}, 'password'); my $secret = encode_base64(genpassword(32)); #Random from set of 62^32 @@ -1250,12 +1257,6 @@ sub newconfig push @dhcpconf, " secret \"" . $secret . "\";\n"; push @dhcpconf, "};\n"; push @dhcpconf, "omapi-key xcat_key;\n"; - push @dhcpconf, "zone $domain. {\n"; - my $ddnserver = $sitedomainservers; - $ddnsserver =~ s/,.*//; - push @dhcpconf, "$domain. {\n"; - push @dhcpconf, " primary $ddnserver; key xcat_key; \n"; - push @dhcpconf, " }\n"; } sub newconfig_aix