diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 99792c097..b86e523eb 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -2301,7 +2301,8 @@ sub dispatch_request { my $errstr; eval { undef $_->{'_xcatdest'}; - + #the xCAT version is included in the request which will be forwarded + $_->{'_xcatver'}=xCAT::Version->Version(); # mainly used by SN to filter out the incorrect module that xcat command came into $_->{'_modname'} = $modname; @@ -2803,6 +2804,23 @@ sub service_connection { delete($req->{tokenid}); } + #for xcat requests forwarded from other nodes, such as MN<-->SN + # compare the version of xCAT which forwarded the request and the + # one which processes the forwarded command + #if the 2 versions are different, a warning message is included in the response + if($req->{'_xcatver'} and $req->{'_xcatver'}->[0]){ + my $myxcatver=xCAT::Version->Version(); + if($req->{'_xcatver'}->[0] ne $myxcatver){ + require Sys::Hostname; + my $myhostname=Sys::Hostname::hostname; + my $resp = { warning => ["$myhostname: my xCAT version \"$myxcatver\" does not match the forwarder's xCAT version \"$req->{'_xcatver'}->[0]\" on $peerhost"]}; + $resp->{serverdone} = [undef]; + send_response($resp, $sock); + #return; + } + } + + # we have a full request.. #printf $request."\n"; $request = "";