From: rettenbe Date: Thu, 7 Feb 2008 16:59:56 +0000 (+0000) Subject: prepare server for bus mac address handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;ds=sidebyside;h=abc542df79adb26e688d10eda09fc4b7e8198a01;p=gosa.git prepare server for bus mac address handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8770 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 8ce80bc1a..195ec65e1 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -812,7 +812,16 @@ sub client_input { $found_ip_flag++ ; } if( $found_ip_flag == 0) { - daemon_log("ERROR: no host found in known_clients with mac address '$answer_target', answer could not be send", 1); + daemon_log("WARNING: no host found in known_clients with mac address '$answer_target', forward msg to bus", 1); + my $sql_statement = "SELECT * FROM known_server WHERE status='bus'"; + my $query_res = $known_server_db->select_dbentry( $sql_statement ); + while( my ($hit_num, $hit) = each %{ $query_res } ) { + my $bus_address = $hit->{hostname}; + my $bus_key = $hit->{hostkey}; + &send_msg_to_target($answer, $bus_address, $bus_key, $answer_header); + last; + } + } } else { diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index eec28447a..fa4d03fd5 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -550,6 +550,7 @@ sub here_i_am { # add entry to known_clients_db + my $act_timestamp = &get_time; my $res = $main::known_clients_db->add_dbentry( {table=>'known_clients', primkey=>'hostname', hostname=>$source, @@ -557,7 +558,7 @@ sub here_i_am { macaddress=>$mac_address, status=>'registered', hostkey=>$new_passwd, - timestamp=>&get_time, + timestamp=>$act_timestamp, } ); if ($res != 0) { @@ -579,6 +580,8 @@ sub here_i_am { # send update msg to bus $out_hash = &create_xml_hash("new_client", $server_address, $bus_address, $source); + &add_content2xml_hash($out_hash, "macaddress", $mac_address); + &add_content2xml_hash($out_hash, "timestamp", $act_timestamp); my $new_client_out = &create_xml_string($out_hash); push(@out_msg_l, $new_client_out); &main::daemon_log("send bus msg that client '$source' has registerd at server '$server_address'", 3);