833 |
|
|
834 |
switch (i) |
switch (i) |
835 |
{ |
{ |
|
case IRCD_SOCKET_ERROR: |
|
|
exit_client(source_p, &me, "Socket Error"); |
|
|
break; |
|
|
|
|
836 |
case TOO_MANY: |
case TOO_MANY: |
837 |
sendto_realops_flags(UMODE_FULL, L_ALL, |
sendto_realops_flags(UMODE_FULL, L_ALL, |
838 |
"Too many on IP for %s (%s).", |
"Too many on IP for %s (%s).", |
1322 |
case CLIENT_TYPE: |
case CLIENT_TYPE: |
1323 |
case OPER_TYPE: |
case OPER_TYPE: |
1324 |
case SERVER_TYPE: |
case SERVER_TYPE: |
1325 |
aconf = (struct AccessItem *)map_to_conf(conf); |
aconf = map_to_conf(conf); |
1326 |
if ((aclass_conf = ClassPtr(aconf)) != NULL) |
if ((aclass_conf = ClassPtr(aconf)) != NULL) |
1327 |
{ |
{ |
1328 |
aclass = (struct ClassItem *)map_to_conf(aclass_conf); |
aclass = map_to_conf(aclass_conf); |
1329 |
|
|
1330 |
if (conf->type == CLIENT_TYPE) |
if (conf->type == CLIENT_TYPE) |
1331 |
remove_from_cidr_check(&client_p->localClient->ip, aclass); |
remove_from_cidr_check(&client_p->localClient->ip, aclass); |
1342 |
if (aconf->clients == 0 && IsConfIllegal(aconf)) |
if (aconf->clients == 0 && IsConfIllegal(aconf)) |
1343 |
delete_conf_item(conf); |
delete_conf_item(conf); |
1344 |
break; |
break; |
1345 |
|
|
1346 |
case LEAF_TYPE: |
case LEAF_TYPE: |
1347 |
case HUB_TYPE: |
case HUB_TYPE: |
1348 |
match_item = (struct MatchItem *)map_to_conf(conf); |
match_item = map_to_conf(conf); |
1349 |
if (match_item->ref_count == 0 && match_item->illegal) |
if (match_item->ref_count == 0 && match_item->illegal) |
1350 |
delete_conf_item(conf); |
delete_conf_item(conf); |
1351 |
break; |
break; |
1374 |
int |
int |
1375 |
attach_conf(struct Client *client_p, struct ConfItem *conf) |
attach_conf(struct Client *client_p, struct ConfItem *conf) |
1376 |
{ |
{ |
|
struct AccessItem *aconf; |
|
|
struct MatchItem *match_item; |
|
|
|
|
1377 |
if (dlinkFind(&client_p->localClient->confs, conf) != NULL) |
if (dlinkFind(&client_p->localClient->confs, conf) != NULL) |
1378 |
return 1; |
return 1; |
1379 |
|
|
1381 |
conf->type == SERVER_TYPE || |
conf->type == SERVER_TYPE || |
1382 |
conf->type == OPER_TYPE) |
conf->type == OPER_TYPE) |
1383 |
{ |
{ |
1384 |
aconf = (struct AccessItem *)map_to_conf(conf); |
struct AccessItem *aconf = map_to_conf(conf); |
1385 |
|
|
1386 |
if (IsConfIllegal(aconf)) |
if (IsConfIllegal(aconf)) |
1387 |
return NOT_AUTHORIZED; |
return NOT_AUTHORIZED; |
1388 |
|
|
1389 |
if (conf->type == CLIENT_TYPE) |
if (conf->type == CLIENT_TYPE) |
1390 |
{ |
{ |
1391 |
struct ClassItem *aclass; |
struct ClassItem *aclass = map_to_conf(aconf->class_ptr); |
|
aclass = (struct ClassItem *)map_to_conf(aconf->class_ptr); |
|
1392 |
|
|
1393 |
if (cidr_limit_reached(IsConfExemptLimits(aconf), |
if (cidr_limit_reached(IsConfExemptLimits(aconf), |
1394 |
&client_p->localClient->ip, aclass)) |
&client_p->localClient->ip, aclass)) |
1395 |
return TOO_MANY; /* Already at maximum allowed */ |
return TOO_MANY; /* Already at maximum allowed */ |
|
|
|
|
CurrUserCount(aclass)++; |
|
1396 |
} |
} |
1397 |
|
|
1398 |
|
CurrUserCount(aclass)++; |
1399 |
aconf->clients++; |
aconf->clients++; |
1400 |
} |
} |
1401 |
else if (conf->type == HUB_TYPE || conf->type == LEAF_TYPE) |
else if (conf->type == HUB_TYPE || conf->type == LEAF_TYPE) |
1402 |
{ |
{ |
1403 |
match_item = (struct MatchItem *)map_to_conf(conf); |
struct MatchItem *match_item = map_to_conf(conf); |
1404 |
match_item->ref_count++; |
match_item->ref_count++; |
1405 |
} |
} |
1406 |
|
|
1434 |
DLINK_FOREACH(ptr, server_items.head) |
DLINK_FOREACH(ptr, server_items.head) |
1435 |
{ |
{ |
1436 |
conf = ptr->data; |
conf = ptr->data; |
1437 |
aconf = (struct AccessItem *)map_to_conf(conf); |
aconf = map_to_conf(conf); |
1438 |
|
|
1439 |
if (match(conf->name, name) == 0 || match(aconf->host, host) == 0) |
if (match(conf->name, name) == 0 || match(aconf->host, host) == 0) |
1440 |
continue; |
continue; |