X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=interface.c;h=0264f464554ee87fdbe4b0e36c527510f6fca7c8;hp=4f7e40a966e20c4d26e3de9f99d55a3e499db75a;hb=ad9a780ce71095bd785eeea8cd6f58606c66ce79;hpb=58afedec93e67db3600e2251d922fa3a4dbd7254 diff --git a/interface.c b/interface.c index 4f7e40a..0264f46 100644 --- a/interface.c +++ b/interface.c @@ -943,7 +943,7 @@ static int inter_gsm_ms(struct interface *interface, char *filename, int line, c /* check if name is used multiple times */ searchif = interface_newlist; while(searchif) { - if (!strcmp(searchif->gsm_ms_name, interface->gsm_ms_name)) { + if (searchif != interface && !strcmp(searchif->gsm_ms_name, interface->gsm_ms_name)) { SPRINT(interface_error, "Error in %s (line %d): mobile '%s' already uses the given MS name '%s', choose a different one.\n", filename, line, interface->gsm_ms_name, searchif->gsm_ms_name); return(-1); } @@ -1583,16 +1583,15 @@ void relink_interfaces(void) struct mISDNport *mISDNport; struct interface_port *ifport; #endif - struct interface *interface, *temp; - int found; + struct interface *interface, *temp, *found; interface = interface_first; while(interface) { - found = 0; + found = NULL; temp = interface_newlist; while(temp) { if (!strcmp(temp->name, interface->name)) - found = 1; + found = temp; temp = temp->next; } if (!found) { @@ -1608,17 +1607,26 @@ void relink_interfaces(void) if (interface->sip) sip_exit_inst(interface); #endif + } else { +#ifdef WITH_SIP + if (interface->sip) { + /* move sip instance, if we keep interface */ + found->sip_inst = interface->sip_inst; + interface->sip_inst = NULL; + } +#endif + ; } interface = interface->next; } interface = interface_newlist; while(interface) { - found = 0; + found = NULL; temp = interface_first; while(temp) { if (!strcmp(temp->name, interface->name)) - found = 1; + found = temp; temp = temp->next; } if (!found) {