X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=socket_server.c;h=28dccd986ab9de8b0ee32f1219f2230c9cc26568;hp=7bb69fcc8ffe11891d75a204f4fe096bd98b2e92;hb=refs%2Fheads%2Fbackup2;hpb=04fc928a2c5f0262e85c09cced1ef20a9fd15f3d diff --git a/socket_server.c b/socket_server.c index 7bb69fc..28dccd9 100644 --- a/socket_server.c +++ b/socket_server.c @@ -618,23 +618,42 @@ int admin_message_to_lcr(struct admin_msg *msg, struct admin_list *admin) return(-1); } - /* new join. the reply (NEWREF assignment) is sent from constructor */ + /* new remote instance. the reply (NEWREF assignment) is sent from constructor */ if (msg->type == MESSAGE_NEWREF) { char name[32]; /* find remote port */ interface = interface_first; while(interface) { - if (interface->remote && !strcmp(interface->remote_app, admin->remote_name)) - break; + /* interface must match the remote application */ + if (interface->remote && !strcmp(interface->remote_app, admin->remote_name)) { + /* interface must match the name, if given */ + if (!msg->param.newref.interface[0] || !strcmp(msg->param.newref.interface, interface->name)) + break; + } interface = interface->next; } if (!interface) { union parameter param; + unsigned int ref = new_remote++; + start_trace(-1, + NULL, + NULL, + NULL, + DIRECTION_NONE, + 0, + 0, + "REMOTE APP illegal interface"); + add_trace("app", "name", "%s", admin->remote_name); + add_trace("interface", "name", "%s", msg->param.newref.interface); + end_trace(); + memset(¶m, 0, sizeof(union parameter)); + param.newref.direction = 0; + admin_message_from_lcr(admin->sock, ref, MESSAGE_NEWREF, ¶m); memset(¶m, 0, sizeof(union parameter)); param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL; param.disconnectinfo.cause = CAUSE_RESSOURCEUNAVAIL; - admin_message_from_lcr(admin->sock, 0, MESSAGE_RELEASE, ¶m); + admin_message_from_lcr(admin->sock, ref, MESSAGE_RELEASE, ¶m); return 0; } /* creating port object, transparent until setup with hdlc */ @@ -733,7 +752,6 @@ int admin_state(struct admin_queue **responsep) class Pdss1 *pdss1; struct mISDNport *mISDNport; struct select_channel *selchannel; - int anybusy; #endif struct interface *interface; struct interface_port *ifport; @@ -918,7 +936,6 @@ int admin_state(struct admin_queue **responsep) } /* channel state */ i = 0; - anybusy = 0; while(i < mISDNport->b_num) { response->am[num].u.i.busy[i] = mISDNport->b_state[i]; if (mISDNport->b_port[i])