diff options
author | Zido <Zido@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-24 21:08:40 +0000 |
---|---|---|
committer | Zido <Zido@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-24 21:08:40 +0000 |
commit | 695e0acba597bb7ccd89592a8cbdc695dca7359e (patch) | |
tree | 338e3b440ab14d756bc45cddd97d5ad06d623ac0 /src/login_sql | |
parent | 3c58502897153fc6b133b79e160ca1f779ced11f (diff) | |
download | hercules-695e0acba597bb7ccd89592a8cbdc695dca7359e.tar.gz hercules-695e0acba597bb7ccd89592a8cbdc695dca7359e.tar.bz2 hercules-695e0acba597bb7ccd89592a8cbdc695dca7359e.tar.xz hercules-695e0acba597bb7ccd89592a8cbdc695dca7359e.zip |
- DNSBL. Refer to changelog.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6258 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql')
-rw-r--r-- | src/login_sql/login.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index ce4afa3e3..f8fbdf692 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -64,6 +64,7 @@ void Gettimeofday(struct timeval *timenow) //-----------------------------------------------------
// global variable
//-----------------------------------------------------
+int use_dnsbl=0; // [Zido]
int server_num;
int new_account_flag = 0; //Set from config too XD [Sirius]
int bind_ip_set_ = 0;
@@ -588,6 +589,35 @@ int mmo_auth( struct mmo_account* account , int fd){ unsigned char *sin_addr = (unsigned char *)&session[fd]->client_addr.sin_addr;
+ char r_ip[16]; // [Zido]
+ char ip_dnsbl[256]; // [Zido]
+
+ // Start DNS Blacklist check [Zido]
+ if(use_dnsbl) {
+ sprintf(r_ip, "%d.%d.%d.%d", sin_addr[3], sin_addr[2], sin_addr[1], sin_addr[0]);
+
+ sprintf(ip_dnsbl,"%s.opm.blitzed.org",r_ip);
+ if(gethostbyname(ip_dnsbl)!=NULL) {
+ ShowInfo("DNSBL: (%s) Blacklisted. User Kicked.\n",r_ip);
+ return 3;
+ }
+ sprintf(ip_dnsbl,"%s.sbl.deltaanime.net",r_ip);
+ if(gethostbyname(ip_dnsbl)!=NULL) {
+ ShowInfo("DNSBL: (%s) Blacklisted. User Kicked.\n",r_ip);
+ return 3;
+ }
+ sprintf(ip_dnsbl,"%s.dnsbl.njabl.org",r_ip);
+ if(gethostbyname(ip_dnsbl)!=NULL) {
+ ShowInfo("DNSBL: (%s) Blacklisted. User Kicked.\n",r_ip);
+ return 3;
+ }
+ sprintf(ip_dnsbl,"%s.sbl-xbl.spamhaus.org",r_ip);
+ if(gethostbyname(ip_dnsbl)!=NULL) {
+ ShowInfo("DNSBL: (%s) Blacklisted. User Kicked.\n",r_ip);
+ return 3;
+ }
+ }
+ // End DNS Blacklist check [Zido]
sprintf(ip, "%d.%d.%d.%d", sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3]);
//ShowInfo("auth start for %s...\n", ip);
@@ -2136,6 +2166,8 @@ int login_config_read(const char *cfgName){ log_login = atoi(w2);
} else if (strcmpi(w1, "import") == 0) {
login_config_read(w2);
+ } else if(strcmpi(w1,"use_dnsbl")==0) { // [Zido]
+ use_dnsbl=atoi(w2);
}
}
fclose(fp);
|