summaryrefslogtreecommitdiff
path: root/src/login_sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/login_sql')
-rw-r--r--src/login_sql/login.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 395f091bf..78f7da3ca 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -578,7 +578,7 @@ int mmo_auth( struct mmo_account* account , int fd){
char ip[16];
- unsigned char *sin_addr = (unsigned char *)&session[fd]->client_addr.sin_addr;
+ unsigned char * sin_addr = (unsigned char *)&session[fd]->client_addr.sin_addr.s_addr;
char r_ip[16]; // [Zido]
char ip_dnsbl[256]; // [Zido]
@@ -905,7 +905,7 @@ int parse_fromchar(int fd){
MYSQL_RES* sql_res;
MYSQL_ROW sql_row = NULL;
- unsigned char *p = (unsigned char *) &session[fd]->client_addr.sin_addr;
+ unsigned char *p = (unsigned char *) &session[fd]->client_addr.sin_addr.s_addr;
char ip[16];
sprintf(ip, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
@@ -1508,10 +1508,8 @@ int parse_login(int fd) {
int packet_len;
int result, i;
- unsigned char *p = (unsigned char *) &session[fd]->client_addr.sin_addr;
- //Since we can't cast a structure to a long, we take the base address as
- //a pointer and cast it (somehow... this seems so wrong to do)
- unsigned long ipl = *((unsigned long *) &session[fd]->client_addr.sin_addr);
+ unsigned char *p = (unsigned char *) &session[fd]->client_addr.sin_addr.s_addr;
+ unsigned long ipl = session[fd]->client_addr.sin_addr.s_addr;
char ip[16];
sprintf(ip, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);