Changeset 88 for trunk/oscam.c
- Timestamp:
- 05/29/09 17:29:08 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam.c
r71 r88 1041 1041 } 1042 1042 1043 static void cs_fake_client(char *usr) 1044 { 1045 int i; 1046 for (i=cdiff+1; i<CS_MAXPID; i++) 1047 if ((client[i].pid) && (client[i].typ=='c') && 1048 (!client[i].dup) && (!strcmp(client[i].usr, usr))) 1049 { 1050 client[i].dup=1; 1051 client[i].au=(-1); 1052 cs_log("client %d duplicate user '%s', set to fake", i-cdiff, usr); 1043 static void cs_fake_client(char *usr, int uniq, in_addr_t ip) 1044 { 1045 /* - Uniq = 1: only one connection per user 1046 * - Uniq = 2: set user only to fake if source ip is different (e.g. for 1047 * newcamd clients with different CAID's -> Ports) 1048 */ 1049 1050 int i; 1051 1052 for (i=cdiff+1; i<CS_MAXPID; i++) { 1053 if (client[i].pid 1054 && (client[i].typ == 'c') 1055 && !client[i].dup 1056 && !strcmp(client[i].usr, usr) 1057 && ((uniq == 1) || (client[i].ip != ip))) 1058 { 1059 client[cs_idx].dup = 1; 1060 client[cs_idx].au = -1; 1061 cs_log("client(%d) duplicate user '%s' from %s set to fake (uniq=%d)", cs_idx-cdiff, usr, cs_inet_ntoa(ip), uniq); 1062 break; 1063 } 1053 1064 } 1054 1065 } … … 1093 1104 memcpy(&client[cs_idx].ctab, &account->ctab, sizeof(client[cs_idx].ctab)); 1094 1105 if (account->uniq) 1095 cs_fake_client(account->usr );1106 cs_fake_client(account->usr, account->uniq, client[cs_idx].ip); 1096 1107 client[cs_idx].ftab = account->ftab; // IDENT filter 1097 1108 client[cs_idx].cltab = account->cltab; // CLASS filter
Note:
See TracChangeset
for help on using the changeset viewer.