| 53 |
|
struct MaskItem * |
| 54 |
|
create_resv(const char *name, const char *reason, const dlink_list *list) |
| 55 |
|
{ |
| 56 |
+ |
dlink_node *ptr = NULL; |
| 57 |
|
struct MaskItem *conf = NULL; |
| 58 |
|
enum maskitem_type type; |
| 59 |
|
|
| 74 |
|
|
| 75 |
|
if (list) |
| 76 |
|
{ |
| 77 |
< |
if (strlen(name) == 2 && IsAlpha(*(name + 1) && IsAlpha(*(name + 2)))) |
| 77 |
> |
DLINK_FOREACH(ptr, list->head) |
| 78 |
|
{ |
| 79 |
< |
struct exempt *exptr = MyMalloc(sizeof(*exptr)); |
| 79 |
> |
char nick[NICKLEN + 1]; |
| 80 |
> |
char user[USERLEN + 1]; |
| 81 |
> |
char host[HOSTLEN + 1]; |
| 82 |
> |
struct split_nuh_item nuh; |
| 83 |
> |
struct exempt *exptr = NULL; |
| 84 |
> |
char *s = ptr->data; |
| 85 |
|
|
| 86 |
< |
exptr->name = xstrdup(name); |
| 81 |
< |
exptr->coid = GeoIP_id_by_code(name); |
| 82 |
< |
dlinkAdd(exptr, &exptr->node, &conf->exempt_list); |
| 83 |
< |
} |
| 84 |
< |
else |
| 85 |
< |
{ |
| 86 |
< |
dlink_node *ptr = NULL; |
| 87 |
< |
|
| 88 |
< |
DLINK_FOREACH(ptr, list->head) |
| 86 |
> |
if (strlen(s) == 2 && IsAlpha(*(s + 1) && IsAlpha(*(s + 2)))) |
| 87 |
|
{ |
| 88 |
< |
char nick[NICKLEN + 1]; |
| 89 |
< |
char user[USERLEN + 1]; |
| 90 |
< |
char host[HOSTLEN + 1]; |
| 91 |
< |
struct split_nuh_item nuh; |
| 92 |
< |
struct exempt *exptr = NULL; |
| 93 |
< |
|
| 94 |
< |
nuh.nuhmask = name; |
| 88 |
> |
exptr = MyMalloc(sizeof(*exptr)); |
| 89 |
> |
exptr->name = xstrdup(s); |
| 90 |
> |
exptr->coid = GeoIP_id_by_code(s); |
| 91 |
> |
dlinkAdd(exptr, &exptr->node, &conf->exempt_list); |
| 92 |
> |
} |
| 93 |
> |
else |
| 94 |
> |
{ |
| 95 |
> |
nuh.nuhmask = s; |
| 96 |
|
nuh.nickptr = nick; |
| 97 |
|
nuh.userptr = user; |
| 98 |
|
nuh.hostptr = host; |
| 104 |
|
split_nuh(&nuh); |
| 105 |
|
|
| 106 |
|
exptr = MyMalloc(sizeof(*exptr)); |
| 107 |
< |
exptr->name = xstrdup(name); |
| 107 |
> |
exptr->name = xstrdup(nick); |
| 108 |
|
exptr->user = xstrdup(user); |
| 109 |
|
exptr->host = xstrdup(host); |
| 110 |
|
exptr->type = parse_netmask(host, &exptr->addr, &exptr->bits); |