projects
/
umurmur.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Admin user role first shot + ban and kick.
[umurmur.git]
/
src
/
client.c
diff --git
a/src/client.c
b/src/client.c
index e4936e2419ef15f6091ceaa6bddd73ab25e5e9d6..81269b6134bfb8a70b250d2d178d4c9c9e69f5ff 100644
(file)
--- a/
src/client.c
+++ b/
src/client.c
@@
-45,6
+45,7
@@
#include "channel.h"
#include "version.h"
#include "voicetarget.h"
#include "channel.h"
#include "version.h"
#include "voicetarget.h"
+#include "ban.h"
extern char system_string[], version_string[];
extern char system_string[], version_string[];
@@
-106,6
+107,7
@@
void Client_janitor()
Client_free(c);
}
}
Client_free(c);
}
}
+ Ban_pruneBanned();
}
void Client_codec_add(client_t *client, int codec)
}
void Client_codec_add(client_t *client, int codec)
@@
-288,7
+290,11
@@
int Client_add(int fd, struct sockaddr_in *remote)
{
client_t *newclient;
message_t *sendmsg;
{
client_t *newclient;
message_t *sendmsg;
-
+
+ if (Ban_isBannedAddr((in_addr_t *)&remote->sin_addr)) {
+ Log_info("Address %s banned. Disconnecting", inet_ntoa(remote->sin_addr));
+ return -1;
+ }
newclient = malloc(sizeof(client_t));
if (newclient == NULL)
Log_fatal("Out of memory");
newclient = malloc(sizeof(client_t));
if (newclient == NULL)
Log_fatal("Out of memory");